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

digital image processinghistogramImage Processing Toolboxrgb profile

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.

Best Answer

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.
Related Question