Find edges by means of a differenceOfExponentialEdgeImage()
Usage: edge infile outfile
#include <iostream>
#include "vigra/stdimage.hxx"
#include "vigra/edgedetection.hxx"
using namespace vigra;
int main(int argc, char ** argv)
{
if(argc != 3)
{
std::cout << "Usage: " << argv[0] << " infile outfile" << std::endl;
return 1;
}
try
{
vigra_precondition(info.
isGrayscale(),
"Sorry, cannot operate on color images");
int which;
std::cout << "Use Canny or Shen-Castan detector (1 or 2) ? ";
std::cin >> which;
double scale;
std::cout << "Operator scale ? ";
std::cin >> scale;
double threshold;
std::cout << "Gradient threshold ? ";
std::cin >> threshold;
out = 255;
if(which == 2)
{
scale, threshold, 0);
}
else
{
scale, threshold, 0);
}
}
catch (vigra::StdException & e)
{
std::cout << e.what() << std::endl;
return 1;
}
return 0;
}