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