图像背景减除

发布于 2024-09-30 17:03:07 字数 344 浏览 3 评论 0原文

我正在开发一个基于浏览器的应用程序,我将在其中获取图像。如果背景很简单,我将必须找到背景并将其删除。就像背景是纯色还是渐变一样。我正在考虑两种选择 - 1)使用 html5 canvas 2)将图像发送到服务器并使用任何好的图像 API 删除背景并将其返回给客户端。

我的问题是“在调用 getImageData() 后使用画布和操作像素是否可行?是否有任何好的算法来删除背景?我尝试搜索它,但我所能找到的只是一些可以购买的文章。我可以用java或javascript实现该算法(如果我使用canvas),如果我选择选项2,将图像发送到服务器并使用任何好的API删除背景,是否有我可以使用的java API

? 。

不胜感激

I am working on a browser based application in which I will get an image. I will have to find the background and remove it if the background is simple. Like if the background is a solid color or gradient. I am considering two options -- 1) using html5 canvas 2) taking the image to the server and remove background using any good image API and get it back to the client.

My question is "Is it feasible to use canvas and manipulate pixels after a call to getImageData()? and is there any good algorithm to remove the background? I tried to search it but all I was able to find were some article to buy. I can implement the algorithm in java or javascript (if I use canvas). Also if I go for option2, take the image to the server and remove background with any good API, is there a java API which I can use?

Any help will be appreciated.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

装迷糊 2024-10-07 17:03:07

我正在开发类似的应用程序。我能想到的是使用 YCrCb 或 rgb2hsv 转换,因为它更注重强度而不是颜色。更多详情请参见此处

借助 HTML5 中可用的 getUserData() 并相应地替换 RGBA 信息

I am working on similar application. What i can think of is to use YCrCb or rgb2hsv conversion as it focus on intensity than color. More deatil can be found here

Take the help of getUserData() available in HTML5 and substitute RGBA information accordingly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文