// Test code to help understand the effect of FFT // The code takes one input image and generate four output images // - magnitude // - phase // - magnitude after log transformation (not provided as log tran // has not been implemented yet) // - image after ifft #include "Image.h" #include "Dip.h" #include #include #include // new: for log() using namespace std; #define Usage "./testfft inimg\n" int main(int argc, char **argv) { Image inimg, outimg, mag, phase, maglog; int nr, nc; int i, j; if (argc < 2) { cout << Usage; exit(3); } // read in image inimg = readImage(argv[1]); nr = inimg.getRow(); nc = inimg.getCol(); // allocate memory mag.createImage(nr, nc); phase.createImage(nr, nc); outimg.createImage(nr, nc); // Fourier transform fft(inimg, mag, phase); // magnitude after log transformation // maglog = logtran(mag); maglog = inimg; // new: allocate memory for (i=0; i