30 #include "Filter/Bilateral.hh"
31 #include "Base/Image/ImageIO.hh"
34 #include <Base/Debug/TimeMeasure.hh>
35 #include <Base/Image/ImageConvert.hh>
37 #include <Base/Common/BIASpragma.hh>
46 int main(
int argc,
char *argv[])
51 cout<<argv[0]<<
" Image [iterations] [filterSize] [sigmaGauss] [sigmaBilateral] [supportImage]\n";
57 double sigmaG=0.7, sigmaB=150.0;
61 cout <<
"Error loading "<<argv[1]<<endl;
65 if(argc > 2) iterations=atoi(argv[2]);
66 if(argc > 3) size=atoi(argv[3]);
67 if(argc > 4) sigmaG=atof(argv[4]);
68 if(argc > 5) sigmaB=atof(argv[5]);
70 cout<<
"Iterations:"<<iterations<<endl;
71 cout<<
"Filter half win size:"<<size<<
"x"<<size<<endl;
72 cout<<
"Sigma Gauss:"<<sigmaG<<endl;
73 cout<<
"Sigma Bilateral:"<<sigmaB<<endl;
78 cout <<
"Error loading "<<argv[6]<<endl;
94 theBilateral.
SetSize(size,size);
97 cout<<
"now filtering FL"<<flush;
110 cout<<
" with support!";
111 for(
int i=0;i<iterations;i++){
112 theBilateral.
Filter(srcf, suppf,dst);
117 for(
int i=0;i<iterations;i++){
118 theBilateral.
Filter(srcf, dst);
132 theBilateral.
SetSize(size,size);
136 cout<<
"now filtering UC"<<flush;
140 cout<<
" with support!";
141 for(
int i=0;i<iterations;i++){
142 theBilateral.
Filter(srcUC, suppUC,dstUC);
146 for(
int i=0;i<iterations;i++){
147 theBilateral.
Filter(srcUC, dstUC);
void SetSize(int newsize, int secondsize=-1)
bool IsEmpty() const
check if ImageData_ points to allocated image buffer or not
void SetSigma(const double si)
virtual int Filter(const Image< InputStorageType > &src, Image< OutputStorageType > &dst)
Bilateral filtering with given filter size (5x5 as standard)
static int ConvertST(const BIAS::ImageBase &source, BIAS::ImageBase &dest, ImageBase::EStorageType targetST)
Function to convert the storage type of images e.g.
unsigned int GetChannelCount() const
returns the number of Color channels, e.g.
The image template class for specific storage types.
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.
void SetIgnoreValue(InputStorageType ignore)
void SetBilateralSigma(const double si)
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...
enum EStorageType GetStorageType() const
(8bit) unsigned char image storage type
This is the base class for images in BIAS.
class TimeMeasure contains functions for timing real time and cpu time.
static int IP_ToGrey(Image< StorageType > &img)
In place conversion to gray image.