#include <iostream>
#include <vigra/multi_array.hxx>
#include <vigra/convolution.hxx>
#include <vigra/nonlineardiffusion.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;
}
int type;
std::cout << "Type of smoothing (1 = Gauss, 2 = Exponential, 3 = nonlinear) ? ";
std::cin >> type;
double scale;
std::cout << "Amount of smoothing (operator scale) ? ";
std::cin >> scale;
double edge_threshold;
if(type == 3)
{
std::cout << "Edge threshold ? ";
std::cin >> edge_threshold;
}
try
{
{
importImage(info, destImage(in));
switch(type)
{
case 2:
{
recursiveSmoothX(in, out, scale);
recursiveSmoothY(out, out, scale);
break;
}
case 3:
{
nonlinearDiffusion(in, out,
break;
}
default:
{
gaussianSmoothing(in, out, scale);
}
}
}
else
{
importImage(info, in);
switch(type)
{
case 2:
{
recursiveSmoothX(in, out, scale);
recursiveSmoothY(out, out, scale);
break;
}
case 3:
{
for(int band = 0; band<3; ++band)
{
nonlinearDiffusion(in.bindElementChannel(band), out.bindElementChannel(band),
}
break;
}
default:
{
gaussianSmoothing(in, out, scale);
}
}
}
}
catch (std::exception & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}
Diffusivity functor for non-linear diffusion.
Definition: nonlineardiffusion.hxx:706
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:2477
image import and export functions