Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

ippiCrossCorrValid_NormLevel_8u_C1RSfs

shyweissman
Beginner
315 Views
I am trying to use cross correlation routine and I get zeros at part of the result matrix. also on opencv code does not. It seems that all parameters are ok.

Ipp8u* imgMatr, max_val;

imgMatr = ippiMalloc_8u_C1(64,64,&stepBytes );

p_img_src = (Ipp8u*)imgCurr8->imageData+rectSrc.x + start_x +

(rectSrc.y + start_y)*imgCurr8->width;

p_img_templ = (Ipp8u*)imgMatch8->imageData+rectMatch.x + rectMatch.y*imgMatch8->width;

IppStatus Corr_status = ippiCrossCorrValid_NormLevel_8u_C1RSfs(p_img_src,imgCurr8->width, srcRoiSize,

p_img_templ, imgMatch8->width,

tplRoiSize, (Ipp8u*)imgMatr, stepBytes, -8);

ippiMaxIndx_8u_C1R(imgMatr, stepBytes, SizeMat, &max_val, max_x, max_y);

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
315 Views
Hi,
there is answer from our expert:

Yes, of course, this code leads to zero matrix. As it is mentioned in ippiman, all correlation coefficients are obtained in 32f data type and 8u output means scaling of 32f coefficients to 8u data type range with appropriate scale factor. For the full 8u range (0-255)you should use scaleFactor = -8.

Regards,
Vladimir
0 Kudos
Intel_C_Intel
Employee
315 Views

Hi,

Another note - IPP cross correlation is calculated after mean subtraction (see manual), so you'll get zeroes for constant images

Alexander

0 Kudos
Reply