35 #include <Filter/FilterNTo2N.hh>
36 #include <Filter/GradientSobel3x3.hh>
37 #include <Filter/GradientGauss.hh>
38 #include <Filter/GradientGaussAsymmetric.hh>
39 #include <Base/Image/ImageIO.hh>
40 #include <Base/Image/ImageConvert.hh>
41 #include <Base/Debug/TimeMeasure.hh>
43 #include <Base/Common/BIASpragma.hh>
48 #define InputImageType unsigned char
49 #define OutputImageType float
51 int main(
int argc,
char *argv[])
83 cerr <<
"GradientGauss\n";
86 grad = &ggaussasymmetric;
87 cerr <<
"GradientGaussAsymmetric\n";
90 BIASERR(
"unknown gradient type");
99 OutputImageType>::TBH_valid);
101 for (
int i=argind; i<argc; i++){
103 BIASERR(
"error loading image "<<argv[i]);
106 cerr <<
"read "<<argv[i]<<endl;
116 gsobel3x3.
Filter(im, gx, gy, g);
120 name <<
"gradx-"<<setw(4)<<setfill(
'0')<<i-argind<<
".mip";
124 name <<
"grady-"<<setw(4)<<setfill(
'0')<<i-argind<<
".mip";
128 name <<
"grad-"<<setw(4)<<setfill(
'0')<<i-argind<<
".mip";
void Print(std::ostream &os=std::cout) const
gradient calculation with separated gauss masks
void AddDebugLevel(const long int lv)
void SetGradGaussRatio(const double ratio)
void SetGradGaussSigma(const double sigma)
base class for simple n->2n filter implementations
virtual parent class for API definition of all (future) filters
gradient calculation with sobel 3 by 3 masks
void SetBorderHandling(const int bh)
static int Save(const std::string &filename, const ImageBase &img, const enum TFileFormat FileFormat=FF_auto, const bool sync=BIAS_DEFAULT_SYNC, const int c_jpeg_quality=BIAS_DEFAULT_IMAGE_QUALITY, const bool forceNewID=BIAS_DEFAULT_FORCENEWID, const bool &writeMetaData=true)
Export image as file using extrnal libs.
gradient calculation with separated gauss masks
static int Load(const std::string &FileName, ImageBase &img)
first tries a call to Read MIP image and if that fails, tries to Import Image with all other availabl...
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &grad)
returns a 2 channel image containing gx and gy
class TimeMeasure contains functions for timing real time and cpu time.