Example for gradient filtering images
- Author
- MIP
#include <Filter/FilterNTo2N.hh>
#include <Filter/GradientSobel3x3.hh>
#include <Filter/GradientGauss.hh>
#include <Filter/GradientGaussAsymmetric.hh>
#include <Base/Image/ImageIO.hh>
#include <Base/Image/ImageConvert.hh>
#include <Base/Debug/TimeMeasure.hh>
#include <Base/Common/BIASpragma.hh>
using namespace BIAS;
using namespace std;
#define InputImageType unsigned char
#define OutputImageType float
int main(int argc, char *argv[])
{
int gt = 1;
switch (gt){
case 0:
grad = &gsobel3x3;
cerr <<"Sobel3x3\n";
break;
case 1:
grad = &ggauss;
cerr <<"GradientGauss\n";
break;
case 2:
grad = &ggaussasymmetric;
cerr <<"GradientGaussAsymmetric\n";
break;
default:
BIASERR("unknown gradient type");
BIASABORT;
break;
}
OutputImageType>::TBH_valid);
int argind = 1;
for (int i=argind; i<argc; i++){
BIASERR("error loading image "<<argv[i]);
return -1;
} else {
cerr << "read "<<argv[i]<<endl;
}
#if type != 1
#endif
gsobel3x3.
Filter(im, gx, gy, g);
ostringstream name;
name << "gradx-"<<setw(4)<<setfill('0')<<i-argind<<".mip";
name.str("");
name << "grady-"<<setw(4)<<setfill('0')<<i-argind<<".mip";
name.str("");
name << "grad-"<<setw(4)<<setfill('0')<<i-argind<<".mip";
}
return 0;
}