How to convert an image to its correspending bw by making certain rgb to appear white and rest black.
5 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152597/image.png)
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.
0 个评论
采纳的回答
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 个评论
Image Analyst
2015-12-14
I already gave you the link. Here it is again: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Just pick whichever color segmentation method you want to try. Actually, download and try all of them.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!