Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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 Kommentar
shivam sahil
shivam sahil am 7 Dez. 2017
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 7 Dez. 2017
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 Kommentare
shivam sahil
shivam sahil am 7 Dez. 2017
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 am 7 Dez. 2017
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by