int main(int argc, char ** argv)
{
const char* filename ="d:/lena.jpg";
IplImage *Input=0, *image, *image1;
int i,j;
cvNamedWindow("1",0);
cvNamedWindow("2",0);
cvNamedWindow("3",0);
Input = cvLoadImage( filename, 0);
image=cvCreateImage(cvGetSize(Input),IPL_DEPTH_8U,1);
image1=cvCreateImage(cvGetSize(Input),IPL_DEPTH_8U,1);
cvShowImage("1",Input);
CvMat* s = cvCreateMat(Input->width,Input->height,CV_32FC1);
CvMat* d = cvCreateMat(Input->width,Input->height,CV_32FC1);
CvMat* e = cvCreateMat(Input->width,Input->height,CV_32FC1);
CvMat* f = cvCreateMat(Input->width,Input->height,CV_32FC1);
cvConvert( Input, s);
cvDFT( s, d, CV_DXT_FORWARD);
cvConvert( d, image);
cvShowImage("2",image);
cvDFT( d, e, CV_DXT_INVERSE);
for(i=0;i<Input->width;i++)
{
for(j=0;j<Input->height;j++)
{
cvSet2D(f,i,j,cvScalar(32,32,32,32));
}
}
cvDiv(e,f,e,1);
cvConvert( e, image1);
cvShowImage("3",image1);
cvWaitKey(-1);
return 1;
}