#include <iostream>
#include <vigra/multi_array.hxx>
int main (int argc, char ** argv)
{
if(argc != 3)
{
std::cout << "Usage: " << argv[0] << " infile outfile" << std::endl;
std::cout << "(supported formats: " << impexListFormats() << ")" << std::endl;
return 1;
}
try
{
{
resultImage(info.
shape());
importImage(info, inputImage);
Shape2 current;
for(current[1] = 0; current[1] < inputImage.shape(1); ++current[1])
{
for (current[0] = 0; current[0] < inputImage.shape(0); ++current[0])
{
Shape2 windowStart = max(Shape2(0), current - Shape2(2));
Shape2 windowStop = min(inputImage.shape(), current + Shape2(3));
resultImage[current] = window.
sum<
float>() / window.
size();
}
}
}
else
{
importImage(info, inputImage);
Shape2 current;
for(current[1] = 0; current[1] < inputImage.shape(1); ++current[1])
{
for (current[0] = 0; current[0] < inputImage.shape(0); ++current[0])
{
Shape2 windowStart = max(Shape2(0), current - Shape2(2));
Shape2 windowStop = min(inputImage.shape(), current + Shape2(3));
}
}
}
return 0;
}
catch (std::exception & e)
{
std::cout << e.what() << std::endl;
return 1;
}
}
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
Base class for, and view to, vigra::MultiArray.
Definition: multi_array.hxx:705
MultiArrayView subarray(difference_type p, difference_type q) const
Definition: multi_array.hxx:1528
U sum() const
Definition: multi_array.hxx:1803
difference_type_1 size() const
Definition: multi_array.hxx:1641
Main MultiArray class containing the memory management.
Definition: multi_array.hxx:2477
Class for a single RGB value.
Definition: rgbvalue.hxx:128
image import and export functions