Find edges by means of a differenceOfExponentialEdgeImage()
Usage: example_edge infile outfile
#include <iostream>
#include <vigra/multi_array.hxx>
#include <vigra/edgedetection.hxx>
{
{
std::cout <<
"Usage: " <<
argv[0] <<
" infile outfile" << std::endl;
std::cout << "(supported formats: " << impexListFormats() << ")" << std::endl;
return 1;
}
try
{
vigra_precondition(
info.isGrayscale(),
"Sorry, cannot operate on color images");
std::cout << "Use Canny or Shen-Castan detector (1 or 2) ? ";
double scale;
std::cout << "Operator scale ? ";
std::cin >> scale;
double threshold;
std::cout << "Gradient threshold ? ";
std::cin >> threshold;
{
differenceOfExponentialEdgeImage(
in,
out, scale, threshold, 0);
}
else
{
cannyEdgeImage(
in,
out, scale, threshold, 0);
}
}
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
image import and export functions