Segment image by means of the watershed algorithm, using seededRegionGrowing()
Usage: example_watershed infile outfile
#include <iostream>
#include <vigra/multi_array.hxx>
#include <vigra/stdimagefunctions.hxx>
#include <vigra/multi_convolution.hxx>
#include <vigra/multi_watersheds.hxx>
template <class InImage, class OutImage>
{
gaussianGradientMagnitude(
in, gradient, scale);
watershedsMultiArray(gradient,
labeling, DirectNeighborhood,
typedef typename NumericTraits<typename InImage::value_type>::RealPromote
NumericTraits<typename OutImage::value_type>::zero());
}
{
{
std::cout <<
"Usage: " <<
argv[0] <<
" infile outfile" << std::endl;
std::cout << "(supported formats: " << impexListFormats() << ")" << std::endl;
return 1;
}
try
{
double scale = 1.0;
std::cout << "Scale for gradient calculation ? ";
std::cin >> scale;
{
std::cout <<
"Writing " <<
argv[2] << std::endl;
}
else
{
std::cout <<
"Writing " <<
argv[2] << std::endl;
}
}
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
Class for a single RGB value.
Definition rgbvalue.hxx:128
Options object for generateWatershedSeeds().
Definition watersheds.hxx:330
Options object for watershed algorithms.
Definition watersheds.hxx:775
image import and export functions