Computes normalized cross-correlation between an image and a template.
Case 1: Operation with integer output
IppStatus ippiCrossCorrFull_Norm_<mod>(const Ipp8u* pSrc, int srcStep, IppiSize srcRoiSize, const Ipp8u* pTpl, int tplStep, IppiSize tplRoiSize, Ipp8u* pDst, int dstStep, int scaleFactor);
Supported values for mod:
8u_C1RSfs |
8u_C3RSfs |
8u_C4RSfs |
8u_AC4RSfs |
Case 2: Operation on data with floating-point output
IppStatus ippiCrossCorrFull_Norm_<mod>(const Ipp<srcDatatype>* pSrc, int srcStep, IppiSize srcRoiSize, const Ipp<srcDatatype>* pTpl, int tplStep, IppiSize tplRoiSize, Ipp32f* pDst, int dstStep);
Supported values for mod:
32f_C1R |
8u32f_C1R |
8s32f_C1R |
16u32f_C1R |
32f_C3R |
8u32f_C3R |
8s32f_C3R |
16u32f_C3R |
32f_C4R |
8u32f_C4R |
8s32f_C4R |
16u32f_C4R |
32f_AC4R |
8u32f_AC4R |
8s32f_AC4R |
16u32f_AC4R |
pSrc |
Pointer to the source image ROI. |
srcStep |
Distance in bytes between starts of consecutive lines in the source image. |
srcRoiSize |
Size of the source ROI in pixels. |
pTpl |
Pointer to the template image buffer. |
tplStep |
Distance in bytes between starts of consecutive lines in the template image. |
tplRoiSize |
Size of the template ROI in pixels. |
pDst |
Pointer to the destination image ROI. |
dstStep |
Distance in bytes between starts of consecutive lines in the destination image. |
scaleFactor |
Scale factor (see Integer Result Scaling). |
The function ippiCrossCorrFull_Norm is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function computes and returns the cross correlation between the source and template images, that is, this function computes the normalized cross-correlation value ρtx(r,c) for each pixel in source and template buffers and stores the computed value in the corresponding pixel of the output image. The size of the resulting matrix with normalized cross-correlation coefficients is
(Ws + Wt - 1) * (Hs + Ht - 1),
where Ws , Hs denote the width and height of the source image, and Wt , Ht denote the width and height of the template.
The template anchor for matching the image pixel is always at the geometric center of the template. (See the formula for ρtx(r,c) in section Image Proximity Measures). There are no requirements for data outside the ROI, and the function requires the template and source images to be zero padded.
For multi-channel images, each channel is processed separately.
Intel IPP does not provide absolute accuracy for rather sophisticated functions. As these functions are intended for 32f data type, all calculations are performed in floats. To avoid divisions by zeroes as well as overflows and underflows, substitutions are implemented for very small denominator values in the course of the normalization phase. Output for these functions is always correct when the source image pixels are normalized - that is, they must be in the range 0.0f - 1.0f. The following example demonstrates how the normalization can be done to have a correct result:
ippiMinMax_32f_C1R( pSrc, srcStep, tmpRoi, &min, &max );
normC = 1.0f/max;
ippiMulC_32f_C1R( normC, pSrc ..);
The only requirement is that both the nominator and the denominator (see the formulas above) must exceed #define IPP_EPS23 ( 1.19209289e-07f ), otherwise substitution is used.
ippStsNoErr |
Indicates no error. Any other value indicates an error or a warning. |
ippStsNullPtrErr |
Indicates an error when any of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error condition when srcRoiSize or tplRoiSize has a field with zero or negative value, or when srcRoiSize has a field with value smaller than value of the corresponding field of tplRoiSize. |
ippStsStepErr |
Indicates an error condition if at least one of srcStep, tplStep, or dstStep has a zero or negative value. |
ippStsMemAllocErr |
Indicates an error condition if memory allocation fails. |
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.