34 #include "Filter/Gauss.hh"
35 #include "Base/Image/ImageIO.hh"
36 #include <Base/Debug/TimeMeasure.hh>
37 #include <Base/Common/BIASpragma.hh>
42 #define TYPE2 unsigned char
45 int main(
int argc,
char *argv[])
51 cout <<
"Error loading "<<argv[1]<<endl;
71 cout<<
"now filtering in 7x7"<<endl;
75 cout<<
"now filtering in int"<<endl;
80 cout<<
"now filtering in float"<<endl;
91 bool WantCompare =
true;
96 cerr <<
"differences between "<<(double)fmin<<
" and "<<(
double)fmax<<endl;
98 bool WantTiming = true;
102 for (
int i=0; i<10; i++){
103 cout<<
"now filtering in int"<<endl;
106 cout<<
"now filtering in float"<<endl;
109 cout<<
"Now comparing performance..."<<endl<<flush;
111 for (
int i=0; i<100; i++){
126 cerr <<
"int took "<<endl;
129 cerr <<
"float took "<<endl;
132 cerr <<
"7x7 took "<<endl;
virtual int Filter7x7Grey(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
fast, approximate, direct implementation, ignoring wrap-arounds, roi is updated but ignored ...
void Print(std::ostream &os=std::cout) const
void AddDebugLevel(const long int lv)
void AbsDiff(const Image< StorageType > &im1, const Image< StorageType > &im2)
(*this) = | im1 - im2 | sets this as the absolute difference between two arg images ...
void GetMinMaxPixelValue(StorageType &min, StorageType &max, unsigned short int channel=0, unsigned int *mincoo=NULL, unsigned int *maxcoo=NULL) const
returns the minimal and maximal pixel value in channel only Finds minimum and maximum pixel value in ...
smoothing with gaussian kernel
virtual int FilterInt(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
sets gauss kernel if params changed and calls convolution
void SetDebugLevel(const long int lv)
void SetSigma(const double si)
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.
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
sets gauss kernel if params changed and calls convolution or fast grey implementation if possible ...
void SetRatio(const double ratio)
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...
class TimeMeasure contains functions for timing real time and cpu time.
virtual int FilterFloat(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
sets gauss kernel if params changed and calls convolution
void SetZero()
zeroes the image