How to create a binary image from hsv image?

15 ビュー (過去 30 日間)
Deepak
Deepak 2013 年 3 月 31 日
コメント済み: Image Analyst 2014 年 3 月 29 日
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!!! :)

回答 (1 件)

Image Analyst
Image Analyst 2013 年 3 月 31 日
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 件のコメント
elaf
elaf 2014 年 3 月 29 日
How Can I get Hue as number not as histogram??
Image Analyst
Image Analyst 2014 年 3 月 29 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by