Frequency distribution of pixel values in video stream

  • Library:
  • Vision HDL Toolbox / Statistics


The Histogram block computes the frequency distribution of pixel values in a video stream. You can configure the number and size of the bins. The block provides a read interface for accessing each bin. The block keeps a running histogram until you reset the bin values.


This block uses a streaming pixel interface with a bus for frame control signals. This interface enables the block to operate independently of image size and format. All Vision HDL Toolbox™ blocks use the same streaming interface. The block accepts both a scalar pixel value and a bus containing five control signals. The control signals indicate the validity of each pixel and its location in the frame. To convert a frame (pixel matrix) into a pixel stream and control signals, use the Frame To Pixels block. For a full description of the interface, see Streaming Pixel Interface.


expand all

Single image pixel, specified as an unsigned integer scalar value.

double and single data types are supported for simulation but not for HDL code generation.

Data Types: single | double | uint | fixed point

Control signals accompanying the pixel stream, specified as a pixelcontrol bus containing five signals. The signals describe the validity of the pixel and its location in the frame. For more information, see Pixel Control Bus.

Data Types: bus

Bin number for reading histogram values, specified as an integer. The block captures this value each cycle that the readRdy output port is 1 (true). The data type is fixdt(0,N,0), N = 5,6,...,10. The word length must be log2(Number of bins).

Data Types: fixed point

A binReset value of 1 ( true) triggers a RAM initialization sequence that resets the histogram bin values.

Data Types: Boolean


expand all

When readRdy is 1 (true), the histogram bins are ready to read.

Data Types: Boolean

Bin value corresponding to the requested address, binAddr.

Data Types: fixed point

When validOut is 1 (true), the histogram value, hist, is valid.

Data Types: Boolean


expand all

Choose the number of bins depending on the input word length (WL). If the number of bins is less than 2WL, the block truncates the least-significant bits of each pixel. If the number of bins is greater than 2WL, the block warns about an inefficient use of hardware resources.

Data type of histogram bin values.

double and single data types are supported for simulation but not for HDL code generation.

Word length of the histogram bins. If a bin overflows, the count saturates and the block shows a warning.


This parameter applies when you set Data type to Unsigned fixed point.


expand all

Extended Capabilities

See Also


System Objects


Introduced in R2015a