Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
6818 Discussions

how to use ippiCrossCorrFull_NormLevel_32f_C3R

feridanes
Beginner
608 Views
Hi,
I'm trying to use "ippiCrossCorrFull_NormLevel_32f_C3R" and i get IND and QNAN value as a result and i am trying to debug my function.
My question is the template argument of this API has tobe 3 channel as well thanks???
Any other inputs are welcome....
regards
Feri
0 Kudos
1 Reply
seiji-torigoe
Beginner
608 Views
#include "ipp.h"
int main(int argc, char* argv[])
{
IppStatus Status;
Ipp32f* pSrc; int srcStep; IppiSize srcRoiSize;
Ipp32f* pTpl; int tplStep; IppiSize tplRoiSize;
Ipp32f* pDst; int dstStep; IppiSize dstRoiSize;
Ipp32f* pWrk; int x, y;

srcRoiSize.width = 5; srcRoiSize.height = 5;
pSrc = ippiMalloc_32f_C3(
srcRoiSize.width, srcRoiSize.height, &srcStep);
Status = ippsZero_8u((Ipp8u*)pSrc, srcStep * srcRoiSize.height);
x = 2; y = 2;
*(pSrc + x * 3 + y * srcStep / sizeof(float) + 0) = 1.0f;
*(pSrc + x * 3 + y * srcStep / sizeof(float) + 1) = 2.0f;
*(pSrc + x * 3 + y * srcStep / sizeof(float) + 2) = 3.0f;
for ( y = 0; y < srcRoiSize.height; y++ )
{
pWrk = pSrc + y * srcStep / sizeof(float);
for ( x = 0; x < srcRoiSize.width; x++ )
{
printf("%f, ", *pWrk); pWrk++;
printf("%f, ", *pWrk); pWrk++;
printf("%f ", *pWrk); pWrk++;
}
printf(" ");
}
printf(" ");
printf(" ");

tplRoiSize.width = 3; tplRoiSize.height = 3;
pTpl = ippiMalloc_32f_C3(
tplRoiSize.width, tplRoiSize.height, &tplStep);
Status = ippsZero_8u((Ipp8u*)pTpl, tplStep * tplRoiSize.height);
x = 1; y = 1;
*(pTpl + x * 3 + y * tplStep / sizeof(float) + 0) = 4.0f;
*(pTpl + x * 3 + y * tplStep / sizeof(float) + 1) = 5.0f;
*(pTpl + x * 3 + y * tplStep / sizeof(float) + 2) = 6.0f;
for ( y = 0; y < tplRoiSize.height; y++ )
{
pWrk = pTpl + y * tplStep / sizeof(float);
for ( x = 0; x < tplRoiSize.width; x++ )
{
printf("%f, ", *pWrk); pWrk++;
printf("%f, ", *pWrk); pWrk++;
printf("%f ", *pWrk); pWrk++;
}
printf(" ");
}
printf(" ");
printf(" ");

dstRoiSize.width = srcRoiSize.width + tplRoiSize.width - 1;
dstRoiSize.height = srcRoiSize.height + tplRoiSize.height - 1;
pDst = ippiMalloc_32f_C3(
dstRoiSize.width, dstRoiSize.height, &dstStep);
// Status = ippsZero_8u((Ipp8u*)pDst, dstStep * dstRoiSize.height);
Status = ippiCrossCorrFull_NormLevel_32f_C3R(
pSrc, srcStep, srcRoiSize,
pTpl, tplStep, tplRoiSize, pDst, dstStep);
for ( y = 0; y < dstRoiSize.height; y++ )
{
pWrk = pDst + y * dstStep / sizeof(float);
for ( x = 0; x < dstRoiSize.width; x++ )
{
printf("%f, ", *pWrk); pWrk++;
printf("%f, ", *pWrk); pWrk++;
printf("%f ", *pWrk); pWrk++;
}
printf(" ");
}

ippiFree(pDst);
ippiFree(pTpl);
ippiFree(pSrc);

return 0;
}

Message Edited by Seiji-Torigoe on 12-14-2004 06:52 PM

0 Kudos
Reply