Creates histogram header.
![]()
Set histogram bin ranges.
![]()
calculates the histogram of one or more single-channel images. The elements of a tuple that is used to increment a histogram bin are taken at the same location from the corresponding input images.

normalizes the histogram bins by scaling them, such that the sum of the bins becomes equal to factor.
![]()
sets all histogram bins to 0.
![]()
Releases the histogram (header and the data).
![]()
Get the histogram bin value at the indexes.
![]()
compares two histograms using specified method and returns the comparison result.

clears histogram bins that are below the specified level.
![]()
finds the minimum and maximum histogram bins

calculates the object probability density from the two histograms as:
histDens(I)=0 if hist1(I)==0
scale if hist1(I)!=0 && hist2(I)>hist1(I)
hist2(I)*scale/hist1(I) if hist1(I)!=0 && hist2(I)<=hist1(I)
So the destination histogram bins are within [0,scale).

Calculates the back project of the histogram. For each tuple of pixels at the same position of all input single-channel images the function puts the value of the histogram bin, corresponding to the tuple, to the destination image. In terms of statistics, the value of each output image pixel is probability of the observed tuple given the distribution (histogram). For example, to find a red object in the picture, one may do the following:
1. Calculate a hue histogram for the red object assuming the image contains only this object. The histogram is likely to have a strong maximum, corresponding to red color.
2. Calculate back projection of a hue plane of input image where the object is searched, using the histogram. Threshold the image.
3. Find connected components in the resulting picture and choose the right component using some additional criteria, for example, the largest connected component.

This vi calculates back projection by comparing histograms of the source
image patches with the given histogram. Taking measurement results from some
image at each location over ROI creates an array img. These results might be
one or more of hue, x derivative, y derivative, Laplacian filter, oriented
Gabor filter, etc. Each measurement output is collected into its own separate
image. The img image array is a collection of these measurement images. A
multi-dimensional histogram hist is constructed by sampling from the img image
array. The final histogram is normalized. The hist histogram has as many
dimensions as the number of elements in img array.
Each new image is measured and then converted into an img image array over a
chosen ROI. Histograms are taken from this img image in an area covered by a
"patch" with anchor at center as shown in the picture below. The
histogram is normalized using the parameter norm_factor so that it may be
compared with hist. The calculated histogram is compared to the model
histogram; hist uses the function cvCompareHist with the comparison
method=method). The resulting output is placed at the location corresponding to
the patch anchor in the probability image dst. This process is repeated as the
patch is slid over the ROI. Iterative histogram update by subtracting trailing
pixels covered by the patch and adding newly covered pixels to the histogram
can save a lot of operations, though it is not implemented yet.
