#include <vigra/multi_array.hxx>
#include <vigra/multi_math.hxx>
#include <iostream>
int main (int argc, char ** argv)
{
if(argc != 4)
{
std::cout << "Usage: " << argv[0] << " infile1 infile2 outfile" << std::endl;
return 1;
}
try
{
info2(argv[2]);
imageArray2(info2.
shape());
Shape2 resultShape = min(info1.shape(), info2.
shape());
Shape2 start1 = (info1.shape() - resultShape) / 2,
end1 = start1 + resultShape;
Shape2 start2 = (info2.
shape() - resultShape) / 2,
end2 = start2 + resultShape;
exportArray = 0.5*subImageArray1 + 0.5*subImageArray2;
}
catch (std::exception & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}
Argument object for the function exportImage().
Definition imageinfo.hxx:134
Argument object for the function importImage().
Definition imageinfo.hxx:391
MultiArrayShape< 2 >::type shape() const
Main MultiArray class containing the memory management.
Definition multi_array.hxx:2479
void exportImage(...)
Write an image to a file.
void importImage(...)
Read an image from a file.
image import and export functions
std::string impexListFormats()
List the image formats VIGRA can read and write.