How to get a plot value of colour rather than rgb in Histogram plot?

2 次查看(过去 30 天)
Using the function imhist() we could easily plot rgb profile of a given image, I was just wondering whether there is a y method in MATLAB to access other color plots and information too or not. For example, I want to see yellow color pixel distribution, Is it possible to plot such pixel variations or not.
  1 个评论
shivam sahil
shivam sahil 2017-12-7
Hey there! First of thanks a lot for the answer. Further, I wanted to add that after completing my analysis on a particular image I came out with these two results one by the code you mentioned and the other using color cloud, can you please explain what these variations actually mean, I found that pixels are being represented in y-axis and what is this hsv value being represented in y-axis. I have attached my result
. Just wanted to be more clear with the physical significance.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2017-12-7
You can use rgb2hsv and look at the histogram of the hue channel
hsvImage = rgb2hsv(rgbImage);
histogram(hsvImage(:,:,1));
You might also like to use the colorcloud() function.
  2 个评论
shivam sahil
shivam sahil 2017-12-7
Hey there! First of thanks a lot for the answer. Further, I wanted to add that after completing my analysis on a particular image I came out with these two results one by the code you mentioned and the other using color cloud, can you please explain what these variations actually mean, I found that pixels are being represented in y-axis and what is this hsv value being represented in y-axis. I have attached both my results.
<<
<<
>>
>>
Image Analyst
Image Analyst 2017-12-7
You only attached one thing - a histogram - not two. If that's the histogram of the hue channel, then you apparently have 5 colors, since you have 5 bars that are non-zero. You have 2 red colors, an orange color, and a yellowish-green color, and a greenish blue color. The vertical height of the bar is the number of pixels with that hue.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Red 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by