2D Histogram
Generate histogram from input
 Library:
Computer Vision Toolbox / Statistics
Description
The 2D Histogram block computes the frequencies of the elements in the input image. The block calculates the histogram values for either the entire input or for each column of the input image. It sorts all the of input values into bins according to their pixel values. The histogram value for a given bin represents the frequency of the input values bracketed by that bin. The block is also capable of computing a running histogram across a sequence of inputs. The block is also capable of computing a running histogram across a sequence of inputs.
Ports
Input
Output
Parameters
Model Examples
Block Characteristics
Data Types 

Multidimensional Signals 

VariableSize Signals 

Algorithms
The histogram bins have equal width of:
$$\Delta =\frac{{B}_{M}{B}_{m}}{n},$$
where
B_{M} — Represents the upper boundary of the highestvalued bin.
B_{m} — Represents the lower boundary of the lowestvalued bin.
n — Represents the number of bins.
The centers are located at:
$${B}_{m}+\left(k+\frac{1}{2}\right)\Delta \begin{array}{cccc}& & & k=0,1,2,\mathrm{...},n1\end{array}.$$
For input values that fall between two bins, the block places them in the lowervalued bin. For input values greater than the upper limit of the histogram or less than the lower limit of the histogram, the block places them in the highestvalued or lowestvalued bin, respectively.
Extended Capabilities
Version History
Introduced before R2006a