#include "Filter/Bilateral.hh"
#include "Base/Image/ImageIO.hh"
#include <iostream>
#include <Base/Debug/TimeMeasure.hh>
#include <Base/Image/ImageConvert.hh>
#include <Base/Common/BIASpragma.hh>
using namespace BIAS;
using namespace std;
#define TYPE1 float
#define TYPE2 float
int main(int argc, char *argv[])
{
if(argc< 2){
cout<<"Usage:"<<endl;
cout<<argv[0]<<" Image [iterations] [filterSize] [sigmaGauss] [sigmaBilateral] [supportImage]\n";
return -1;
}
double sigmaG=0.7, sigmaB=150.0;
int size=2;
int iterations = 1;
cout <<"Error loading "<<argv[1]<<endl;
exit(-1);
}
if(argc > 2) iterations=atoi(argv[2]);
if(argc > 3) size=atoi(argv[3]);
if(argc > 4) sigmaG=atof(argv[4]);
if(argc > 5) sigmaB=atof(argv[5]);
cout<<"Iterations:"<<iterations<<endl;
cout<<"Filter half win size:"<<size<<"x"<<size<<endl;
cout<<"Sigma Gauss:"<<sigmaG<<endl;
cout<<"Sigma Bilateral:"<<sigmaB<<endl;
if(argc > 6) {
cout <<"Error loading "<<argv[6]<<endl;
exit(-1);
}
}
srcf = srcbase;
cout<<"now filtering FL"<<flush;
}
else
suppf = suppbase;
}
cout<<" with support!";
for(int i=0;i<iterations;i++){
theBilateral.
Filter(srcf, suppf,dst);
srcf = dst;
}
}
else{
for(int i=0;i<iterations;i++){
theBilateral.
Filter(srcf, dst);
srcf = dst;
}
}
cout<<endl;
srcUC = srcbase;
cout<<"now filtering UC"<<flush;
suppUC = suppbase;
cout<<" with support!";
for(int i=0;i<iterations;i++){
theBilateral.
Filter(srcUC, suppUC,dstUC);
}
}
else{
for(int i=0;i<iterations;i++){
theBilateral.
Filter(srcUC, dstUC);
srcUC = dstUC;
}
}
cout<<endl;
}
return 0;
}