[Wavelet-commit] Wavelet/tools pgmcompare.cc, 1.5, 1.6 pgmcount.cc, 1.3, 1.4 pgmdenoise.cc, 1.3, 1.
Status: Beta
Brought to you by:
herbert
From: Herbert M. D. <he...@us...> - 2007-08-07 17:01:07
|
Update of /cvsroot/wavelet/Wavelet/tools In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6566/tools Modified Files: pgmcompare.cc pgmcount.cc pgmdenoise.cc pgmdiff.cc pgmequalize.cc pgmhist.cc pgminmax.cc pgmpixel.cc pgmscale.cc pgmstats.cc vid2pgm.cc video2grey.cc wavepgm.cc waveppm.cc Log Message: Various bugfixes, added ImageResizer tool class which allows smart cropping of color images (not very sophisticated yet). Index: video2grey.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/video2grey.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** video2grey.cc 10 Aug 2005 09:35:23 -0000 1.13 --- video2grey.cc 7 Aug 2007 17:01:01 -0000 1.14 *************** *** 7,11 **** */ ! #include <assert.h> #include <iostream> #include <stdexcept> --- 7,11 ---- */ ! #include <cassert> #include <iostream> #include <stdexcept> Index: pgmscale.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmscale.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmscale.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmscale.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 9,15 **** #include <iostream> #include <stdexcept> ! #include <stdio.h> ! #include <math.h> ! #include <assert.h> #include <Wave.hh> --- 9,15 ---- #include <iostream> #include <stdexcept> ! #include <cstdio> ! #include <cmath> ! #include <cassert> #include <Wave.hh> *************** *** 38,42 **** { cerr << "Usage: pgmscale <infile> <outfile> <factor> [optional]" << endl; ! cerr << "Optional: [<function> [<stages> [<filter> [hlfunc [lhfunc]]]]]" << endl; return 1; --- 38,42 ---- { cerr << "Usage: pgmscale <infile> <outfile> <factor> [optional]" << endl; ! cerr << "Optional: [<function> [<stages> [<filter> [hlfunc [lhfunc]]]]]" << endl; return 1; *************** *** 85,89 **** int hlfunc = -1; int lhfunc = -1; ! if (argc > 7) { --- 85,89 ---- int hlfunc = -1; int lhfunc = -1; ! if (argc > 7) { *************** *** 94,98 **** } } ! if (argc > 8) { --- 94,98 ---- } } ! if (argc > 8) { *************** *** 103,108 **** } } ! ! try { --- 103,108 ---- } } ! ! try { *************** *** 116,120 **** WaveletTransform *transform = NULL; ! if (stages > 1) { --- 116,120 ---- WaveletTransform *transform = NULL; ! if (stages > 1) { *************** *** 130,139 **** } } ! Image *image2 = NULL; Image **lh = NULL; Image **hl = NULL; ! if (stages > 1 && lhfunc >= 0) { --- 130,139 ---- } } ! Image *image2 = NULL; Image **lh = NULL; Image **hl = NULL; ! if (stages > 1 && lhfunc >= 0) { *************** *** 147,151 **** } catch (const exception &error) ! { cerr << "Error: " << error.what () << endl; return 1; --- 147,151 ---- } catch (const exception &error) ! { cerr << "Error: " << error.what () << endl; return 1; *************** *** 166,170 **** } catch (const exception &error) ! { cerr << "Error: " << error.what () << endl; return 1; --- 166,170 ---- } catch (const exception &error) ! { cerr << "Error: " << error.what () << endl; return 1; *************** *** 185,193 **** DELETENOTNULL (transform); ! if (stages > 1) { transform = NEW (PyramidTransform (*image2, *filter)); ! if (lhfunc >= 0) { --- 185,193 ---- DELETENOTNULL (transform); ! if (stages > 1) { transform = NEW (PyramidTransform (*image2, *filter)); ! if (lhfunc >= 0) { *************** *** 237,241 **** DELETE (image1); DELETE (image2); ! return 0; } --- 237,241 ---- DELETE (image1); DELETE (image2); ! return 0; } Index: waveppm.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/waveppm.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** waveppm.cc 10 Aug 2005 09:35:23 -0000 1.4 --- waveppm.cc 7 Aug 2007 17:01:01 -0000 1.5 *************** *** 9,15 **** #include <iostream> #include <stdexcept> ! #include <assert.h> ! #include <stdio.h> ! #include <math.h> #include <Wave.hh> --- 9,15 ---- #include <iostream> #include <stdexcept> ! #include <cassert> ! #include <cstdio> ! #include <cmath> #include <Wave.hh> Index: pgmstats.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmstats.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmstats.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmstats.cc 7 Aug 2007 17:01:01 -0000 1.4 *************** *** 10,14 **** #include <iomanip> #include <stdexcept> ! #include <stdio.h> #include <WTools.hh> --- 10,14 ---- #include <iomanip> #include <stdexcept> ! #include <cstdio> #include <WTools.hh> Index: pgmhist.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmhist.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmhist.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmhist.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 10,15 **** #include <iomanip> #include <stdexcept> ! #include <stdio.h> ! #include <string.h> #include <WTools.hh> --- 10,15 ---- #include <iomanip> #include <stdexcept> ! #include <cstdio> ! #include <cstring> #include <WTools.hh> Index: pgmcount.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmcount.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmcount.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmcount.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 9,14 **** #include <iostream> #include <stdexcept> ! #include <stdio.h> ! #include <math.h> #include <WTools.hh> --- 9,14 ---- #include <iostream> #include <stdexcept> ! #include <cstdio> ! #include <cmath> #include <WTools.hh> Index: pgmequalize.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmequalize.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pgmequalize.cc 10 Aug 2005 09:35:23 -0000 1.4 --- pgmequalize.cc 7 Aug 2007 17:01:00 -0000 1.5 *************** *** 9,15 **** #include <iostream> #include <stdexcept> ! #include <stdio.h> ! #include <math.h> ! #include <assert.h> #include <WImage.hh> --- 9,15 ---- #include <iostream> #include <stdexcept> ! #include <cstdio> ! #include <cmath> ! #include <cassert> #include <WImage.hh> Index: vid2pgm.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/vid2pgm.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** vid2pgm.cc 15 Aug 2005 16:24:23 -0000 1.6 --- vid2pgm.cc 7 Aug 2007 17:01:01 -0000 1.7 *************** *** 7,13 **** */ ! #include <assert.h> #include <iostream> ! #include <stdio.h> #include <stdexcept> #include <iomanip> --- 7,13 ---- */ ! #include <cassert> #include <iostream> ! #include <cstdio> #include <stdexcept> #include <iomanip> Index: wavepgm.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/wavepgm.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wavepgm.cc 10 Aug 2005 09:35:23 -0000 1.4 --- wavepgm.cc 7 Aug 2007 17:01:01 -0000 1.5 *************** *** 9,15 **** #include <iostream> #include <stdexcept> ! #include <assert.h> ! #include <stdio.h> ! #include <math.h> #include <Wave.hh> --- 9,15 ---- #include <iostream> #include <stdexcept> ! #include <cassert> ! #include <cstdio> ! #include <cmath> #include <Wave.hh> Index: pgmcompare.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmcompare.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pgmcompare.cc 10 Aug 2005 09:35:23 -0000 1.5 --- pgmcompare.cc 7 Aug 2007 17:01:00 -0000 1.6 *************** *** 10,16 **** #include <iomanip> #include <stdexcept> ! #include <assert.h> ! #include <stdio.h> ! #include <math.h> #include <WTools.hh> --- 10,16 ---- #include <iomanip> #include <stdexcept> ! #include <cassert> ! #include <cstdio> ! #include <cmath> #include <WTools.hh> *************** *** 59,65 **** int myArgc = argc; char **myArgv = argv; ! /* Preliminary steps */ ! cerr << "pgmcompare version " << WAVE_VERSION << " (c) 2001-2004 by Herbert" #ifdef PFI --- 59,65 ---- int myArgc = argc; char **myArgv = argv; ! /* Preliminary steps */ ! cerr << "pgmcompare version " << WAVE_VERSION << " (c) 2001-2004 by Herbert" #ifdef PFI *************** *** 77,81 **** if (myArgc < 3 || myArgc > 5) { ! cerr << "Usage: pgmcompare [-s] <file1> <file2> [<percent> [<type>]]" << endl << " default for percent is " << percent << endl --- 77,81 ---- if (myArgc < 3 || myArgc > 5) { ! cerr << "Usage: pgmcompare [-s] <file1> <file2> [<percent> [<type>]]" << endl << " default for percent is " << percent << endl *************** *** 92,96 **** } } ! if (myArgc > 4) { --- 92,96 ---- } } ! if (myArgc > 4) { *************** *** 103,107 **** type = (imgtype)i; } ! try { --- 103,107 ---- type = (imgtype)i; } ! try { *************** *** 113,117 **** return 1; } ! try { --- 113,117 ---- return 1; } ! try { *************** *** 141,147 **** mse = comparison->cmpmse (); ! rmse = sqrt (mse); psnr = (mse == 0? -1: comparison->cmpsnr ()); ! cout.setf (ios::fixed, ios::floatfield); cout << "MSE: " << std::setprecision (5) << std::setw (11) << mse << endl --- 141,147 ---- mse = comparison->cmpmse (); ! rmse = sqrt (mse); psnr = (mse == 0? -1: comparison->cmpsnr ()); ! cout.setf (ios::fixed, ios::floatfield); cout << "MSE: " << std::setprecision (5) << std::setw (11) << mse << endl *************** *** 162,166 **** } ! try { score = comparison->distlq (percent, filter, type); --- 162,166 ---- } ! try { score = comparison->distlq (percent, filter, type); *************** *** 178,193 **** /* Print the statistics */ ! cout << "L^q: " << std::setprecision (5) << std::setw (11) << score.colors + score.details << endl; ! cout << "Lq_d: " << std::setprecision (5) << std::setw (10) << lqd_norm << endl; ! cout.setf (FMT0, ios::floatfield); cleanup: ! DELETE (img1); DELETE (img2); ! return 0; } --- 178,193 ---- /* Print the statistics */ ! cout << "L^q: " << std::setprecision (5) << std::setw (11) << score.colors + score.details << endl; ! cout << "Lq_d: " << std::setprecision (5) << std::setw (10) << lqd_norm << endl; ! cout.setf (FMT0, ios::floatfield); cleanup: ! DELETE (img1); DELETE (img2); ! return 0; } Index: pgmdiff.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmdiff.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmdiff.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmdiff.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 9,13 **** #include <iostream> #include <stdexcept> ! #include <stdio.h> #include <WTools.hh> --- 9,13 ---- #include <iostream> #include <stdexcept> ! #include <cstdio> #include <WTools.hh> Index: pgminmax.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgminmax.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgminmax.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgminmax.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 10,14 **** #include <iomanip> #include <stdexcept> ! #include <stdio.h> #include <WTools.hh> --- 10,14 ---- #include <iomanip> #include <stdexcept> ! #include <cstdio> #include <WTools.hh> Index: pgmpixel.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmpixel.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmpixel.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmpixel.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 9,14 **** #include <iostream> #include <stdexcept> ! #include <string.h> ! #include <stdio.h> #include <Wave.hh> --- 9,14 ---- #include <iostream> #include <stdexcept> ! #include <cstring> ! #include <cstdio> #include <Wave.hh> Index: pgmdenoise.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/tools/pgmdenoise.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pgmdenoise.cc 10 Aug 2005 09:35:23 -0000 1.3 --- pgmdenoise.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 9,15 **** #include <iostream> #include <stdexcept> ! #include <stdio.h> ! #include <math.h> ! #include <assert.h> #include <WTools.hh> --- 9,15 ---- #include <iostream> #include <stdexcept> ! #include <cstdio> ! #include <cmath> ! #include <cassert> #include <WTools.hh> |