imhist
Compute image histogram counts.
📝Syntax
counts = imhist(I)
[counts, binLocations] = imhist(I)
[counts, binLocations] = imhist(I, n)
📥Input Arguments
Parameter Description
I Input intensity or logical image.
n Positive integer number of histogram bins.
📤Output Arguments
Parameter Description
counts Histogram counts as a column vector.
binLocations Bin locations on the native image scale.
📄Description

Compute image histogram counts. Bin locations use the native scale for integer images and the range [0, 1] for floating-point and logical images.

💡Examples
Display an image histogram
I=repmat(linspace(0,1,96),64,1);
[counts,bins]=imhist(I,32);
figure; bar(bins,counts); title('Histogram');
Example illustration
🔗See Also
imadjustgraythresh
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub