00001
00002
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 #include <string.h>
00006 #include <tip.h>
00007
00008
00009
00010
00011
00012
00013
00014
00015 int main(int argc, char *argv[])
00016 {
00017
00018 if (argc != 2) {
00019 cout << "Usage: " << argv[0] << " <input_image>" << endl;
00020 exit(0);
00021 }
00022
00023
00024
00025 FloatImage im0;
00026 im0.readImage(argv[1]);
00027 im0.showImage();
00028
00029
00030 cout << "Original image statistics" << endl;
00031 cout << " Min: " << im0.min() << endl;
00032 cout << " Max: " << im0.max() << endl;
00033 cout << " Avg: " << im0.avg() << endl;
00034 cout << " Std. dev.: " << im0.dev() << endl << endl;
00035
00036
00037
00038
00039 FloatImage fourier_real, fourier_imag;
00040 fft(im0, fourier_real, fourier_imag);
00041
00042
00043
00044 FloatImage result;
00045 ifft(fourier_real, fourier_imag, result);
00046 result.showImage();
00047
00048
00049 cout << "FFT/IFFT image statistics" << endl;
00050 cout << " Min: " << result.min() << endl;
00051 cout << " Max: " << result.max() << endl;
00052 cout << " Avg: " << result.avg() << endl;
00053 cout << " Std. dev.: " << result.dev() << endl << endl;
00054
00055 char l;
00056 cin >> l;
00057
00058 result.closeWindow();
00059 im0.closeWindow();
00060 return(1);
00061 }