Thread: [Wavelet-commit] Wavelet/test christina57.jpg, NONE, 1.1 imageresizer.cc, NONE, 1.1 prod_18_schuh1.
Status: Beta
Brought to you by:
herbert
From: Herbert M. D. <he...@us...> - 2007-08-07 17:01:09
|
Update of /cvsroot/wavelet/Wavelet/test In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6566/test Modified Files: Makefile.in Makefile.msc Makefile.watcomc coeffinfo.cc colorimage.cc filename.cc histogram.cc image.cc imagearray.cc imagefile.cc imageinfo.cc position.cc vectors.cc videos.cc wavelet.cc Added Files: christina57.jpg imageresizer.cc prod_18_schuh1.jpg Log Message: Various bugfixes, added ImageResizer tool class which allows smart cropping of color images (not very sophisticated yet). Index: Makefile.in =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/Makefile.in,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.in 15 Aug 2005 17:09:41 -0000 1.4 --- Makefile.in 7 Aug 2007 17:01:00 -0000 1.5 *************** *** 43,49 **** TESTS = imagearray_test vectors_test position_test imagefile_test \ ! filename_test image_test wavelet_test coeffinfo_test ntree_test \ ! imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test PROGRAMS = $(TESTS:_test=$E) benchmark$E DEPENDS = $(TESTS:_test=.dd) benchmark.dd --- 43,49 ---- TESTS = imagearray_test vectors_test position_test imagefile_test \ ! filename_test image_test wavelet_test coeffinfo_test ntree_test \ ! imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test imageresizer_test PROGRAMS = $(TESTS:_test=$E) benchmark$E DEPENDS = $(TESTS:_test=.dd) benchmark.dd *************** *** 113,116 **** --- 113,120 ---- @-rm -f harin[0-9][0-9]*.pgm harin-*.vid temp-*.avi + imageresizer_test: imageresizer$E + @./$< + @-rm -f harin[0-9][0-9]*.pgm harin-*.vid temp-*.avi + # # Flags passed to the compiler *************** *** 186,189 **** --- 190,196 ---- $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) + imageresizer$E: imageresizer$O ../libwavelet$A + $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) + ../libwavelet$A: ../*.cc ../*.hh ../Wave/*.hh ../*.h $(MAKE) -C ../ static Index: videos.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/videos.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** videos.cc 15 Aug 2005 16:24:23 -0000 1.9 --- videos.cc 7 Aug 2007 17:01:00 -0000 1.10 *************** *** 16,23 **** #endif ! #include <assert.h> #include <iostream> #include <iomanip> ! #include <math.h> #include "WImage/debug.h" #include "WImage/VideoFrame.hh" --- 16,23 ---- #endif ! #include <cassert> #include <iostream> #include <iomanip> ! #include <cmath> #include "WImage/debug.h" #include "WImage/VideoFrame.hh" Index: imagearray.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/imagearray.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** imagearray.cc 15 Aug 2005 16:24:23 -0000 1.4 --- imagearray.cc 7 Aug 2007 17:01:00 -0000 1.5 *************** *** 16,20 **** #endif ! #include <assert.h> #include <iostream> #include <iomanip> --- 16,20 ---- #endif ! #include <cassert> #include <iostream> #include <iomanip> --- NEW FILE: christina57.jpg --- (This appears to be a binary file; contents omitted.) Index: imagefile.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/imagefile.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** imagefile.cc 10 Aug 2005 09:35:23 -0000 1.3 --- imagefile.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 16,25 **** #endif ! #include <math.h> ! #include <assert.h> #include <iostream> #include <stdexcept> #include <iomanip> ! #include <float.h> #include "../ImageArray.cc" #include "WImage/PgmReader.hh" --- 16,25 ---- #endif ! #include <cmath> ! #include <cassert> #include <iostream> #include <stdexcept> #include <iomanip> ! #include <cfloat> #include "../ImageArray.cc" #include "WImage/PgmReader.hh" --- NEW FILE: prod_18_schuh1.jpg --- (This appears to be a binary file; contents omitted.) Index: Makefile.watcomc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/Makefile.watcomc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.watcomc 30 Nov 2004 15:43:10 -0000 1.3 --- Makefile.watcomc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 5,15 **** filename_test image_test wavelet_test coeffinfo_test ntree_test & imageinfo_test colorimage_test transform_test histogram_test & ! videos_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E & wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E & ! transform$E histogram$E benchmark$E videos$E OBJECTS = imagearray$O vectors$O position$O imagefile$O filename$O image$O & wavelet$O coeffinfo$O imageinfo$O colorimage$O benchmark$O ntree$O & ! transform$O histogram$O benchmark$O videos$O CPPFLAGS = -i=.. -i=..\..\pfi -dDPRINTF="" -dPFI -dJPEG --- 5,15 ---- filename_test image_test wavelet_test coeffinfo_test ntree_test & imageinfo_test colorimage_test transform_test histogram_test & ! videos_test imageresizer_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E & wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E & ! transform$E histogram$E benchmark$E videos$E imageresizer$E OBJECTS = imagearray$O vectors$O position$O imagefile$O filename$O image$O & wavelet$O coeffinfo$O imageinfo$O colorimage$O benchmark$O ntree$O & ! transform$O histogram$O benchmark$O videos$O imageresizer$O CPPFLAGS = -i=.. -i=..\..\pfi -dDPRINTF="" -dPFI -dJPEG *************** *** 81,84 **** --- 81,88 ---- @-del harin[0-9][0-9]*.pgm harin-*.vid + imageresizer_test: imageresizer$E .SYMBOLIC + @.\\imageresizer$E + @-del harin[0-9][0-9]*.pgm harin-*.vid + clean : .SYMBOLIC -del $(PROGRAMS) $(OBJECTS) Index: filename.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/filename.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filename.cc 10 Aug 2005 09:35:23 -0000 1.4 --- filename.cc 7 Aug 2007 17:01:00 -0000 1.5 *************** *** 13,17 **** #include "WImage/FileName.hh" #include "WImage/miscdefs.h" ! #include <assert.h> #include <iostream> --- 13,17 ---- #include "WImage/FileName.hh" #include "WImage/miscdefs.h" ! #include <cassert> #include <iostream> --- NEW FILE: imageresizer.cc --- /* * Test program for the class ImageResizer * * $Date: 2007/08/07 17:01:00 $ * $Revision: 1.1 $ * */ #ifdef NDEBUG #undef NDEBUG #endif /* NDEBUG */ #include "WImage/StillImage.hh" #include "WImage/ColorImage.hh" #include "WTools/ImageResizer.hh" #include "testing.h" #include <cassert> #include <iostream> #include <iomanip> #include <stdexcept> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) using namespace std; #endif static void testColorDumbResizing (void); static void testGreyscaleDumbResizing (void); int main (void) { cout << "Testing class ImageResizer...\n"; ColorImage *img = NEW (ColorImage ()); ColorImage * result; TEST_NO_EXCEPTION (img->read ("prod_18_schuh1.jpg")); // 768x1024 //TEST_NO_EXCEPTION (img->read ("rita.jpg")); // 768x1024 //TEST_NO_EXCEPTION (img->read ("christina57.jpg")); // 594x448 //TEST_NO_EXCEPTION (img->read ("lena128.ppm")); // 128x128 //int white[3] = { 255, 255, 255 }; int red[3] = { 255, 0, 0 }; ImageResizer ir (*img, Haar, red, 0.001); //TEST_NO_EXCEPTION (result = ir.resize(100, 200)); TEST_NO_EXCEPTION (result = ir.resize(80, 300)); cout << "score: " << 20000 * ir.getInnerAvgPerSize () << endl; //TEST_NO_EXCEPTION (result = ir.resize(340, 300)); //TEST_NO_EXCEPTION (result = ir.resize(64, 64)); TEST_NO_EXCEPTION (result->write("out.jpg")); cout << "Test of class ImageResizer completed successfully.\n"; return 0; testColorDumbResizing (); testGreyscaleDumbResizing (); return 0; } static void testGreyscaleDumbResizing (void) { cout << " ... greyscale dumb resizing... " << endl; Image *img = NEW(StillImage ()); TEST_NO_EXCEPTION (img->read ("lena.pgm")); // 512x448 cout << " source rows: " << img->rows() << ", cols: " << img->cols() << endl; Image *result = NULL; TEST_NO_EXCEPTION(result = img->fitInto(480, 420)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-480x420.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(480, 420, 255)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-480x420-fill.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(530, 448)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-530x448.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(530, 448, 255)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-530x448-fill.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(440, 530)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-440x530.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(440, 530, 255)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-440x530-fill.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(530, 420)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-530x420.pgm")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(530, 420, 255)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("lena-530x420-fill.pgm")); DELETE (result); DELETE(img); } static void testColorDumbResizing (void) { cout << " ... color dumb resizing... " << endl; ColorImage *img = NEW (ColorImage ()); TEST_NO_EXCEPTION (img->read ("christina57.jpg")); // 594x448 cout << " source rows: " << img->rows() << ", cols: " << img->cols() << endl; cout << " source colormodel: " << img->colormodel() << endl; ColorImage *result = NULL; int red[3] = { 255, 0, 0 }; int blue[3] = { 0, 255, 0 }; int green[3] = { 0, 0, 255 }; int white[3] = { 255, 255, 255 }; TEST_NO_EXCEPTION(result = img->fitInto(550, 420)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-550x420.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(550, 420, red)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-550x420-fill.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(600, 580)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-600x580.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(600, 580, blue)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-600x580-fill.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(550, 420)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-550x420.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(550, 420, green)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-550x420-fill.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(680, 400)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-680x400.jpg")); DELETE (result); TEST_NO_EXCEPTION(result = img->fitInto(680, 400, white)); cout << " rows: " << result->rows() << ", cols: " << result->cols() << endl; TEST_NO_EXCEPTION(result->write("christina-680x400-fill.jpg")); DELETE (result); DELETE(img); } Index: wavelet.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/wavelet.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wavelet.cc 10 Aug 2005 09:35:23 -0000 1.3 --- wavelet.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 15,24 **** #endif ! #include <stdio.h> ! #include <assert.h> #include <iostream> #include <iomanip> ! #include <math.h> ! #include <float.h> #include "../ImageArray.cc" #include "WImage/RowVector.hh" --- 15,24 ---- #endif ! #include <cstdio> ! #include <cassert> #include <iostream> #include <iomanip> ! #include <cmath> ! #include <cfloat> #include "../ImageArray.cc" #include "WImage/RowVector.hh" Index: coeffinfo.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/coeffinfo.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** coeffinfo.cc 10 Aug 2005 09:35:23 -0000 1.2 --- coeffinfo.cc 7 Aug 2007 17:01:00 -0000 1.3 *************** *** 12,16 **** #include "WImage/CoeffInformation.hh" ! #include <assert.h> #include <iostream> --- 12,16 ---- #include "WImage/CoeffInformation.hh" ! #include <cassert> #include <iostream> Index: position.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/position.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** position.cc 10 Aug 2005 09:35:23 -0000 1.3 --- position.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 13,17 **** #include "Wave/MirrorPosition.hh" #include "Wave/PeriodicPosition.hh" ! #include <assert.h> #include <iostream> --- 13,17 ---- #include "Wave/MirrorPosition.hh" #include "Wave/PeriodicPosition.hh" ! #include <cassert> #include <iostream> Index: image.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/image.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** image.cc 22 May 2007 14:55:45 -0000 1.5 --- image.cc 7 Aug 2007 17:01:00 -0000 1.6 *************** *** 11,20 **** #endif /* NDEBUG */ ! #include <assert.h> #include <iostream> #include <iomanip> #include <stdexcept> ! #include <math.h> ! #include <float.h> #include "WImage/StillImage.hh" --- 11,20 ---- #endif /* NDEBUG */ ! #include <cassert> #include <iostream> #include <iomanip> #include <stdexcept> ! #include <cmath> ! #include <cfloat> #include "WImage/StillImage.hh" Index: Makefile.msc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/Makefile.msc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.msc 30 Nov 2004 15:36:04 -0000 1.3 --- Makefile.msc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 30,37 **** filename_test image_test wavelet_test coeffinfo_test ntree_test \ imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E \ wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E \ ! transform$E histogram$E videos$E tests: $(TESTS) --- 30,37 ---- filename_test image_test wavelet_test coeffinfo_test ntree_test \ imageinfo_test colorimage_test transform_test histogram_test \ ! videos_test imageresizer_test PROGRAMS = imagearray$E vectors$E position$E imagefile$E filename$E image$E \ wavelet$E coeffinfo$E imageinfo$E colorimage$E benchmark$E ntree$E \ ! transform$E histogram$E videos$E imageresizer$E tests: $(TESTS) *************** *** 97,100 **** --- 97,104 ---- @-del harin[0-9][0-9]*.pgm harin-*.vid + imageresizer_test: imageresizer$E + @.\\imageresizer$E + @-del harin[0-9][0-9]*.pgm harin-*.vid + # # Flags passed to the compiler *************** *** 135,138 **** --- 139,143 ---- histogram$E: histogram$O videos$E: videos$O + imageresizer$E: imageresizer$O clean: Index: colorimage.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/colorimage.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** colorimage.cc 10 Aug 2005 09:35:23 -0000 1.3 --- colorimage.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 10,14 **** */ ! #include <assert.h> #include <iostream> #include <stdexcept> --- 10,14 ---- */ ! #include <cassert> #include <iostream> #include <stdexcept> Index: histogram.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/histogram.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** histogram.cc 10 Aug 2005 09:35:23 -0000 1.3 --- histogram.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 13,17 **** #include "WTools/Histogram.hh" #include "WImage/StillImage.hh" ! #include <assert.h> #include <iostream> #include <iomanip> --- 13,17 ---- #include "WTools/Histogram.hh" #include "WImage/StillImage.hh" ! #include <cassert> #include <iostream> #include <iomanip> Index: imageinfo.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/imageinfo.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** imageinfo.cc 10 Aug 2005 09:35:23 -0000 1.3 --- imageinfo.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 13,22 **** #include "WTools/ImageInformation.hh" #include "WImage/StillImage.hh" ! #include <assert.h> #include <iostream> #include <iomanip> #include <stdexcept> ! #include <stdlib.h> ! #include <math.h> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) --- 13,22 ---- #include "WTools/ImageInformation.hh" #include "WImage/StillImage.hh" ! #include <cassert> #include <iostream> #include <iomanip> #include <stdexcept> ! #include <cstdlib> ! #include <cmath> #if !(defined __WATCOMC__ && __WATCOMC__ < 1230) Index: vectors.cc =================================================================== RCS file: /cvsroot/wavelet/Wavelet/test/vectors.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** vectors.cc 10 Aug 2005 09:35:23 -0000 1.3 --- vectors.cc 7 Aug 2007 17:01:00 -0000 1.4 *************** *** 16,20 **** #endif ! #include <assert.h> #include <iostream> #include <iomanip> --- 16,20 ---- #endif ! #include <cassert> #include <iostream> #include <iomanip> |