MATLAB: Imhist(P,10) , imhist(P,256) What are the differences among resulting histograms

digital image processingimageimage processingImage Processing Toolbox

I'm a new MATLAB user. I don't understand the meaning of bins used in imhist command. Can someone tell me the differences between the resulting histograms imhist(P,10), imhist(P,256)

Best Answer

A uint8 image might have intensities in the range of 0-255. If you use 256 bins, you get a count of how many pixels have each gray level. If you use 10 bins, you get a count of how many pixels are in the range 0-24, 25-49, 50-74, and so on.
Related Question