Read an image file and write out a subimage
Usage: subimage infile outfile
#include <iostream>
#include "vigra/stdimage.hxx"
#include "vigra/stdimagefunctions.hxx"
using namespace vigra;
int main(int argc, char ** argv)
{
if(argc != 3)
{
std::cout << "Usage: " << argv[0] << " infile outfile" << std::endl;
return 1;
}
try
{
int sub_x0 = info.
width() / 4;
int sub_y0 = info.
height() / 4;
int sub_x1 = info.
width() - sub_x0;
int sub_y1 = info.
height() - sub_y0;
{
destImage(out));
}
else
{
destImage(out));
}
}
catch (vigra::StdException & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}