Specifications
Image Statistics Functions
12-13
12
NormCrossCorr
Computes normalized cross-correlation
between an image and a template.
IPLStatus iplNormCrossCorr (IplImage*
srcImage
,
IplImage*
tplImage
, IplImage*
dstImage
);
srcImage, tplImage
The source and template images.
dstImage
The destination image.
Discussion
For each pixel in
srcImage
, the function iplNormCrossCorr() computes
the normalized cross-correlation value ρ
tx
(r,c) with the template
tplImage
,
and stores the computed value in the corresponding pixel of the output
image
dstImage
. The template anchor for matching the image pixel is
always at the geometric center of the template. (See the formula for ρ
tx
on
the previous page.)
All three images passed to
iplNormCrossCorr() must have the same data
order (pixels or planes), origin (top-left or bottom-left), number of
channels, alpha channel number, and COI number. The function supports
images with 8-bit and 16-bit pixel data (both signed and unsigned) as well
as 32-bit signed and 32-bit floating-point data.
Both
srcImage
and
dstImage
can have any combination of ROIs
(rectangular ROIs, mask ROIs, and COIs). If you set any of these ROIs, the
function will update pixels of
dstImage
only in the intersection of all
applicable ROIs.
The
tplImage
’s mask, even if present, has no effect on the results.
The source and destination images can be either tiled or non-tiled. The
template image must be non-tiled only.
The function returns
IPL_StsOK on success, and an error status code on
failure.