Photoshop like Magic Wand for selecting pixels of a similar color, but in VB.NET

纵然是瞬间 提交于 2019-12-07 22:44:58

问题


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..


回答1:


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:

  • Different Methods of Performing FloodFill
  • Flood Fill Algorithms
  • QuickFill/flood fill algorithm in C#/VB.NET


来源:https://stackoverflow.com/questions/7437945/photoshop-like-magic-wand-for-selecting-pixels-of-a-similar-color-but-in-vb-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!