// Test code for the FFT and IFFT functions using a simple numerical example // and how padding can be done during the implementation of convolution // in the frequency domain #include "Image.h" #include "Dip.h" #include #include using namespace std; #define Usage "./testfft_num \n" int main(int argc, char **argv) { Image inimg, mag, phase, outimg, img2, img3; int imgsize = 4; int i, j; if (argc < 1) { cout << Usage; exit(3); } // create the image inimg.createImage(imgsize, imgsize); inimg(0,0) = inimg(1,1) = inimg(2,2) = inimg(3,3) = 255.0; cout << "Input image:\n" << inimg << endl; // for padding img2.createImage(2*imgsize, 2*imgsize); for (i=0; i