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 int main(int argc, char *argv[])
00015 {
00016
00017 if (argc != 2) {
00018 cout << "Usage: " << argv[0] << " <input_image>" << endl;
00019 exit(0);
00020 }
00021
00022 FloatImage im1;
00023 im1.readImage(argv[1]);
00024
00025 FloatKernel k(im1.getWidth(),im1.getHeight(), "Gauss");
00026 k.makeGauss(3.0);
00027
00028
00029
00030
00031 Timer t;
00032 FloatImage res1(im1.getWidth(), im1.getHeight(), "Result");
00033 t.Start();
00034 float t1 = t.getTime();
00035 float t2;
00036 for (int i=0;i<40;i++) {
00037 k.makeGauss(4*i+0.75);
00038 Convolution(im1, k, res1);
00039 t2 = t.getTime();
00040 cout << t2 - t1 << endl;
00041 }
00042
00043
00044
00045 res1.showImage();
00046 t.Stop();
00047 t.Print();
00048 char c;
00049 cin >> c;
00050 }