Specifications
Intel
®
Image Processing Library Reference Manual
7-6
7
Example 7-1 Computing the FFT of an Image (continued)
if( NULL == imga ) return 0;
imgb = iplCreateImageHeader(
1, 0, IPL_DEPTH_16S, "GRAY", "GRAY",
IPL_DATA_ORDER_PIXEL, IPL_ORIGIN_TL,
IPL_ALIGN_DWORD, 4, 4, NULL, NULL,
NULL, NULL);
if( NULL == imgb ) return 0;
// Create without filling
iplAllocateImage( imga, 0,0 );
if( NULL == imga->imageData ) return 0;
// Fill by sample data
for( i=0; i<16; i++)
((char*)imga->imageData)[i] = (char)src[i];
iplAllocateImage( imgb, 0, 0 );
if( NULL == imgb->imageData ) return 0;
iplRealFft2D( imga, imgb, IPL_FFT_Forw );
// Compare Matlab and ipl result here
iplCcsFft2D( imgb, imga, IPL_FFT_Inv );
// Compare source data and obtained data
// Check if an error was occured
if( iplGetErrStatus() != IPL_StsOk ) return 0;
}
__finally {
iplRealFft2D( NULL, NULL, IPL_FFT_Free );
iplDeallocate(imga,IPL_IMAGE_HEADER|IPL_IMAGE_DATA);
iplDeallocate(imgb,IPL_IMAGE_HEADER|IPL_IMAGE_DATA);
}
return IPL_StsOk == iplGetErrStatus();
}