#include #include "MPT_GaborPyramid.h" #include "matlab_imresize.h" #include "rimage.h" #include "rimage_ser.h" bool test_imresize( int argc, char *argv[] ); int main( int argc, char *argv[] ) { test_imresize( argc, argv ); return 0; // if( argc < 2 ) // { // std::cerr << "Usage: " << argv[0] << " " << std::endl; // return -1; // } // RImage image(96,96); // mpt::GaborPyramid gabor( image, image.width, image.height ); // if( !gabor.importPaddedFilters( argv[1] ) ) // { // std::cerr << "Failed to read gabor filters from: " << argv[1] << std::endl; // return -1; // } } bool test_imresize( int argc, char *argv[] ) { if( argc < 2 ) { std::cerr << "Usage: " << argv[0] << " " << std::endl; return false; } RImage input; RImage output; std::string filename( argv[1] ); if( !restoreRImageFromFile( input, filename ) ) { std::cerr << "Unable to open input image: " << filename << std::endl; return false; } matlab_imresize( input, output, 0.5 ); filename = "imresize_out.rimage"; if( !saveRImageToFile( output, filename ) ) { std::cerr << "Unable to save output image: " << filename << std::endl; return false; } return true; }