Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   Related Pages   Examples  

test_wavelet2.cpp

00001 /* Copyright (c) 2001 C. Grigorescu */
00002 
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 #include <string.h>
00006 #include <tip.h>
00007 
00008 //   Example program for the "fwt" and "ifwt" functions.
00009 //
00010 //   Usage:
00011 //      test_wavelet2 <input_image> 
00012 //
00013 
00014 int main(int argc, char *argv[])
00015 {
00016   // Test for the correct number of arguments in the command line.
00017   if (argc != 2) {
00018     cout << "Usage: " << argv[0] << " <input_image>" << endl;
00019     exit(0);
00020   }
00021 
00022   char l;
00023 
00024   // Read an floating point valued image and display it.
00025   FloatImage im0;
00026   im0.readImage(argv[1]);
00027   im0.showImage();
00028   cin >> l;
00029 
00030   // Perform a 3-level decomposition (direct FWT) on the "im0" image with
00031   // a BIOR_1_3 set of wavelets.
00032   fwt(im0, 3, BIOR_1_3);
00033 
00034   // Display the result of the FWT.
00035   im0.showImage();
00036   cin >> l;
00037 
00038   // Perform a 3-level reconstruction (inverse FWT) on the "im0" image
00039   // using the BIOR_1_3 set of wavelets.
00040   ifwt(im0, 3, BIOR_1_3);
00041   im0.showImage();
00042   cin >> l;
00043   
00044   im0.closeWindow();
00045 
00046   return(1);
00047 }