Compares histogram, computed over each possible rectangular patch of the specified size in the input images, and stores the results to the output map dst.

C# | Visual Basic | Visual C++ |
public static void cvCalcBackProjectPatch( IntPtr[] images, IntPtr dst, Size patchSize, IntPtr hist, HISTOGRAM_COMP_METHOD method, float factor )

- images (array< IntPtr >[]()[])
- Source images (though, you may pass CvMat** as well), all of the same size
- dst (IntPtr)
- Destination image.
- patchSize (Size)
- Size of patch slid though the source images.
- hist (IntPtr)
- Histogram
- method (HISTOGRAM_COMP_METHOD)
- Comparison methof
- factor (Single)
- Normalization factor for histograms, will affect normalization scale of destination image, pass 1. if unsure.

In pseudo-code the operation may be written as:
for (x,y) in images (until (x+patch_size.width-1,y+patch_size.height-1) is inside the images) do
compute histogram over the ROI (x,y,x+patch_size.width,y+patch_size.height) in images
(see cvCalcHist)
normalize the histogram using the factor
(see cvNormalizeHist)
compare the normalized histogram with input histogram hist using the specified method
(see cvCompareHist)
store the result to dst(x,y)
end for