How to create a binary image from hsv image?

2 vues (au cours des 30 derniers jours)
Deepak
Deepak le 31 Mar 2013
Commenté : Image Analyst le 29 Mar 2014
I have an hsv image which contains some yellow colored regions and other colored regions, my aim is to get an image in which the pixels that do not satisfy the yellow shaded regions are removed(i.e, represented by black color) and yellow colored regions represented by white color.
Please help me to accomplish the same.
P.S. I am a newb to image processing, don't have much experience in this field. So, any detailed help would b really useful.
Thanks in advance!!! :)

Réponses (1)

Image Analyst
Image Analyst le 31 Mar 2013
See my demo on "Simple color detection by hue": http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862. It does that, and it's well commented.
  2 commentaires
elaf
elaf le 29 Mar 2014
How Can I get Hue as number not as histogram??
Image Analyst
Image Analyst le 29 Mar 2014
Each pixel has a hue. You can get the hue of each pixel in the image like this:
hsv = rgb2hsv(rgbImage);
hueImage = hsv(:, :, 1);
You can get a histogram of the hue, you can view it as an image, you can extract out the hue of one or more pixels, or you can get the mean of a box or irregular shape that you specify. What do you want to do? Originally I thought you wanted to get all the yellow pixels, which is why I gave you code to do that. But now you want something different that I don't know what it is.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Image Processing Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by