How to convert an image to its correspending bw by making certain rgb to appear white and rest black.

5 次查看(过去 30 天)
I want a code which would convert an image into its corresponding bw image .the code should ask me to select certain rgb values which would appear white in the binary image and would blacken out the rest. for example if I want to convert the above image into bw form the program would ask for rgb values I would like to see as white in binary image (in this case triangles ,circles and squares)and blacken outs the rest. please help me with a method other than setting level as in the exam the colors of the objects would be different and we are no allowed to set levels on the spot.

采纳的回答

Image Analyst
Image Analyst 2015-12-13
There is no image attached. But anyway, see my Image Segmentation by Delta E color difference in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. It will do what you ask for. It lets the user trace out a color in the image, then it finds all pixels within a certain color difference of that color and gets a binary image. Then it masks the image so that you see matching color regions and non-matching color regions.
  4 个评论

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by