Specifications
Intel
®
Image Processing Library Reference Manual
7-10
7
Discussion
The function iplDCT2D() performs a DCT on each channel in the
specified rectangular ROI of the input image
srcImage
and writes the
DCT coefficients into the corresponding channel of the output image
dstImage
. The output data will be clamped (saturated) to the limits Min
and Max,whereMin and Max are determined by the data type of the output
image. For best results, use 32-bit data or, at least, 16-bit data.
Example 7-2 Computing the DCT of an Image
int example72( void ) {
IplImage *imga, *imgb;
const int width = 8, height = 8;
int i, x, y;
__try {
imga = iplCreateImageHeader(
1, 0, IPL_DEPTH_8U, "GRAY", "GRAY",
IPL_DATA_ORDER_PIXEL, IPL_ORIGIN_TL,
IPL_ALIGN_DWORD, width, height, NULL, NULL,
NULL, NULL);
if( NULL == imga ) return 0;
imgb = iplCreateImageHeader(
1, 0, IPL_DEPTH_16S, "GRAY", "GRAY",
IPL_DATA_ORDER_PIXEL, IPL_ORIGIN_TL,
IPL_ALIGN_DWORD, width, height, NULL, NULL,
NULL, NULL);
if( NULL == imgb ) return 0;
continued ☞