- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, All.
I try to get IPP documentation Wiener filtering example working.
Ipp32f pSrc[256*256];
Ipp32f pDst[256*256];
int srcStep = 256*sizeof(Ipp32f);
int dstStep = 256*sizeof(Ipp32f);
IppiSize roiSize = {256, 256};
IppiSize dstRoiSize = {256, 256};
IppiSize maskSize = {3, 3};
int pBufferSize;
int channels = 1;
unsigned int pSeed = 3;
IppiPoint anchor = {1, 1};
Ipp32f noise[1] = {0.5};
ippiImageJaehne_32f_C1R(pSrc, srcStep, roiSize); // source image
//source image + RandUniform noise
ippiAddRandUniform_Direct_32f_C1IR(pSrc, srcStep, roiSize, 0, 1, &pSeed);
ippiFilterWienerGetBufferSize( dstRoiSize, maskSize, channels, &pBufferSize);
Ipp8u* pBuffer = ippsMalloc_8u(pBufferSize);
ippiFilterWiener_32f_C1R( pSrc, srcStep, pDst, dstStep, dstRoiSize, maskSize, anchor, noise, pBuffer);
ippsFree(pBuffer);
After executing this code under Linux on Intel Xeon CPU L5408 @ 2.13GHz , IPP ver. 6.0.0.045 pDst buffer contains NAN values.
Is there anything I am doing wrong? Any help would be appreciated.
Regards,
Artem
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ying
#include "stdio.h"
#include "ipp.h"
int main()
{
IppStatus stat = ippStsNoErr;
int length = 256*256;
Ipp32f pSrc[256*256];
Ipp32f *pSrcW;
Ipp32f pDst[256*256];
int srcStep = 256*sizeof(Ipp32f);
int dstStep = 256*sizeof(Ipp32f);
IppiSize roiSize = {256, 256};
IppiSize maskSize = {3, 3};
IppiSize dstRoiSize = {256-maskSize.width, 256-maskSize.height};
int pBufferSize;
int channels = 1;
unsigned int pSeed = 3;
IppiPoint anchor = {1, 1};
Ipp32f noise[1] = {0.0};
Ipp8u* pBuffer;
stat = ippiImageJaehne_32f_C1R(pSrc, srcStep, roiSize);
if( stat != ippStsNoErr ){
printf (" ERROR !!! n");
return 1;
}
stat = ippiFilterWienerGetBufferSize( dstRoiSize, maskSize, channels, &pBufferSize);
if( stat != ippStsNoErr ){
printf (" ERROR !!! n");
return 1;
}
stat = ippsSet_32f( 1.0, pDst, length );
pBuffer = ippsMalloc_8u(pBufferSize);
pSrcW = (Ipp32f*)((Ipp8u*)pSrc + (maskSize.height - 1 - anchor.y ) * srcStep + (maskSize.width - 1 - anchor.x ) * sizeof(Ipp32f) );
stat = ippiFilterWiener_32f_C1R( pSrcW, srcStep, pDst, dstStep, dstRoiSize, maskSize, anchor, noise, pBuffer);
if( stat != ippStsNoErr ){
printf (" ERROR !!! n");
return 1;
}
ippsFree(pBuffer);
return 0;
}// __main__
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page