CrossCorrSame_NormLevel

Computes normalized correlation coefficient between an image and a template.

Syntax

Case 1: Operation with integer output

IppStatus ippiCrossCorrSame_NormLevel_<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 ippiCrossCorrSame_NormLevel_<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

Parameters

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).

Description

The function ippiCrossCorrSame_NormLevel is declared in the ippi.h file. It operates with ROI (see Regions of Interest in Intel IPP). This function computes the normalized correlation coefficients γtx(r,c) for the pixels that belong only to the source image. The size of the resulting matrix with normalized correlation coefficients is equal to the size of the source image: Ws * Hs , where Ws , Hs denote the width and height of the source image, respectively.

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. The function performs as if the source image ROI is zero padded.

Note iconNote

For multi-channel images, each channel is processed separately.

Example “Using the function ippiCrossCorrSame_NormLevel” shows how to use the function ippiCrossCorrSame_NormLevel_32f_C1R.

Return Values

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.

Using the function ippiCrossCorrSame_NormLevel

void func_CrossCorrSame_NormLevel()
{
    Ipp32f pSrc[5*4] = { 1.0, 2.0, 1.5, 4.1, 3.6,
                         0.2, 3.2, 2.5, 1.5, 10.0,
                         5.0, 6.8, 0.5, 4.1, 1.1,
                         7.1, 4.2, 2.2, 8.7, 10.0};
 
    Ipp32f pTpl[3*3] = {2.1, 3.5, 7.7,
                        0.4, 2.3, 5.5,
                        1.4, 2.8, 3.1};
    Ipp32f pDst[5*4];
 
    IppiSize srcRoiSize = {5, 4};
    IppiSize tplRoiSize = {3, 3};
    int srcStep = 5*sizeof(Ipp32f);
    int tplStep = 3*sizeof(Ipp32f);
    int dstStep = 5*sizeof(Ipp32f);
 
    ippiCrossCorrSame_NormLevel_32f_C1R(pSrc, srcStep, srcRoiSize,
 pTpl, tplStep, tplRoiSize, pDst, dstStep);
}
Result:              pDst
          0.16  -0.14  -0.17  -0.10  -0.36
          0.31  -0.08  -0.12   0.55  -0.43
          0.42  -0.49  -0.34   0.46  -0.39
          0.63  -0.38   0.31   0.21  -0.53
 

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.