Clear Filters
Clear Filters

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

5 views (last 30 days)
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.

Accepted Answer

Image Analyst
Image Analyst on 13 Dec 2015
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 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!