32 #include <Filter/CannyEdge.hh>
33 #include <Utils/IOUtils.hh>
34 #include <Utils/Param.hh>
35 #include <Base/Image/ImageConvert.hh>
40 int main(
int argc,
char *argv[]) {
43 string *inName = param.
AddParamString(
"input",
"detect edges in this image",
"input.mip",
'i');
44 string *outName = param.
AddParamString(
"output",
"output image",
"cannyEdges.mip",
'o');
46 int *lowThres = param.
AddParamInt(
"low",
"low threshold", 80, 0, 100,
't');
47 int *highThres = param.
AddParamInt(
"high",
"high threshold", 5, 0, 100,
'T');
49 if (!IOUtils::ParseCommandLineEvalHelp(param, argc, argv))
55 ImageIO::Load(*inName, srcbase);
58 ImageIO::Load(*inName, srcf);
60 ImageConvert::ConvertST(srcf, src, ImageBase::ST_unsignedchar);
65 BIASWARN(
"Converting input image to Grey Image");
66 ImageConvert::IP_ToGrey(src);
74 ImageIO::Save(*outName, dst);
int ScaleShiftBetween(double Min, double Max)
scales and shifts image so afterwards every pixel has a value between Min and Max ...
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
int SetThresholdsRelative(unsigned int low_, unsigned int high_)
set value of low and high thresholds for hysteresis in magnitude gradient image in terms of percent o...
This class Param provides generic support for parameters.
enum EStorageType GetStorageType() const
int * AddParamInt(const std::string &name, const std::string &help, int deflt=0, int min=std::numeric_limits< int >::min(), int max=std::numeric_limits< int >::max(), char cmdshort=0, int Group=GRP_NOSHOW)
For all adding routines:
int SetEdgeWidth(unsigned int edgeWidth)
set edge width for hysteresis.
This is the base class for images in BIAS.
std::string * AddParamString(const std::string &name, const std::string &help, std::string deflt="", char cmdshort=0, int Group=GRP_NOSHOW)
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &gx, Image< OutputStorageType > &gy, Image< OutputStorageType > &magnitude, Image< OutputStorageType > &gdir, Image< OutputStorageType > &dst)
call for getting all intermediary results