/* prog2p2.c -- Image Processing with Haar wavelets Written November 12, 2011 by Eric Olson for Math 761 This program makes use of the Haar wavelet transform given in the file haar2d.c. The command gcc -o prog2p2 prog2p2.c haar2d.c pgmio.c -lm will compile this program in most POSIX/GNU environments. */ #include #include #include #define N 512 #define epsilon 0.1 double y[N][N]; int main() { int n, m; printf("prog2p2.c -- Image Processing with Haar Wavelets\n" "Written November 12, 2011 by Eric Olson for Math 761\n\n"); readimage((double *) y, N, "image1.pgm"); haar2d(y, N); printf("Processing...\n"); for(n = 0; n < N; n++) for(m = 0; m < N; m++) if(fabs(y[n][m]) < epsilon) y[n][m] = 0; ihaar2d(y, N); writeimage((double *) y, N, "test.pgm"); exit(0); }