Question concerning color segmentation performance.

6 views (last 30 days)
Hello there!
I am looking to perform color segmentation on specific images in order to isolate the green objects in the image (more specifically, a green glove). I have this part covered, with all credit going to Image Analyst, whose Simple Color Detection code is the basis of the program, which is attached. However, I've encountered a problem where, in very similar circumstances, I successfully isolate the green in one image, while I am unable to detect any green at all in the other. I am using the same thresholds all throughout.
Specifically, said successful image is here:
While unsuccessful image is here:
Can anyone please explain why this happens? Is it simply a matter of adjusting the thresholds ever so slightly, or is there something I am missing here?
And if possible, is there a way for me to improve the performance and robustness of this color segmentation method?
Thank you for your time. Any help would be greatly appreciated.

Accepted Answer

Image Analyst
Image Analyst on 6 Sep 2014
Probably. My demo code (attached below here) gives you the histograms of the h, s, and v channels. You need to see where green lies. It's probably around 0.2-0.4 or so You might have to combine it with other color channels. For example since everything else is some shade of gray, you might be able to threshold on the saturation channel. Attach your two images (working and not working) if you want more help.
  4 Comments
Image Analyst
Image Analyst on 8 Sep 2014
So now that you've had a chance to try it, what do you think? Good enough to accept the answer, or not?
Cosmic Clarity
Cosmic Clarity on 8 Sep 2014
You've suggested a lot of ways to improve the program, and these codes will help immensely in optimizing the color segmentation. This is more than enough. Thank you for the help.

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!