Photoshop 类似于 Magic Wand,用于选择相似颜色的像素,但在 VB.NET 中
我是个菜鸟。
我需要编写一些 vb.net 代码来查看图片并“删除”黑色像素。
这是场景。伤口护理医生在平板扫描仪上拍摄人手的照片。漂亮的粉红色掌纹就在那里,但周围都是黑色的图片。我想通过以编程方式“删除”或重新着色黑色范围内的像素来使图片流行。即Photoshop魔术棒选择并删除。
我还没有开始编写代码。希望有一些参考代码而不仅仅是pcode。 搜索stackoverflow,我还没有找到答案。 有想法吗?请讨论并非常感谢您的考虑..
Im a noob.
I need to write some vb.net code that looks at a picture and "removes" the blackish pixels.
Here's the scenario. A wound care doctor takes a picture of a persons hand on a flat bed scanner. The nice pink palm print is there but it is surrounded by blackish pictures. I want to make the picture pop by programatically "removing" or recoloring the pixels that are in the blackish range. i.e. the Photoshop magic wand select and delete.
I have not code to start off. Hoping for some reference code and not just pcode.
Searching stackoverflow, I have not yet found an answer.
Got ideas? Please discuss and many thanks for considering..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这与 Flood Fill 算法非常相似,该算法在图片中查找相似颜色的区域,并将该区域中的所有像素替换为不同的颜色(就像油漆一样)。
您只需要定义一个阈值,而不是绘制像素,而是跟踪它们而不进行任何修改。
以下是 SO 中的一些洪水填充问题可能会有所帮助:
This is very similar to the Flood Fill algorithm, that finds a zone of similar colors in a picture, and replaces all the pixels in that zone into a different color (like paint does).
You just need to define a threshold, and instead of painting the pixels, keep track of them without doing any modification.
Here are some Flood Fill questions in SO that might help: