34 #include "Filter/Binomial.hh"
35 #include "Base/Image/ImageIO.hh"
38 #include <Base/Debug/TimeMeasure.hh>
43 #define TYPE2 unsigned char
45 int main(
int argc,
char *argv[])
50 cout <<
"usage: "<<argv[0]<<
" <image>\n";
57 cout <<
"Error loading "<<argv[1]<<endl;
75 theBinomial.
Filter(src, dst);
79 cout<<
"now filtering in int"<<endl;
84 cout<<
"now filtering in float"<<endl;
89 bool WantCompare =
true;
94 cerr <<
"differences between "<<(double)fmin<<
" and "<<(
double)fmax<<endl;
96 bool WantTiming = true;
100 for (
int i=0; i<1; i++){
101 cout<<
"now filtering in int"<<endl;
104 cout<<
"now filtering in float"<<endl;
107 cout<<
"Now comparing performance..."<<endl<<flush;
109 for (
int i=0; i<1; i++){
119 cerr <<
"int took "<<endl;
122 cerr <<
"float took "<<endl;
void Print(std::ostream &os=std::cout) const
void AddDebugLevel(const long int lv)
virtual int FilterFloat(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
no implementation, calls Filter
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 ...
virtual int FilterInt(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
no implementation, calls Filter
void SetDebugLevel(const long int lv)
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 kernel if params changed and calls convolution
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...
binomial low pass filter class
void SetHalfWinSize(int hws)
class TimeMeasure contains functions for timing real time and cpu time.
void SetZero()
zeroes the image