MATLAB: How does the imhist function work for RGB image

digital image processingimage analysisimage processingImage Processing ToolboxMATLAB

Hello everyone.
I looked up the use of imhist function. It plots the histogram for a grayscale image. But if the input is an RGB image, it still produces a histogram? Is it converting the RGB to grayscale and then showing the histogram?
And would it be technically correct to show the histogram for a RGB image this way? Thanks in advance!

Best Answer

Did you try to look at the source code
>> edit imhist.m
Also, see attached demo. You might like it.
Related Question