Example for usage of ConstantRegionDetector, LinearRegionDetector, BlobDetectorDOM Usage: ExampleConstantRegion <im1> [ <im2> <im3> ... ]
#include <bias_config.h>
#include <FeatureDetector/ConstantRegionDetector.hh>
#include <FeatureDetector/LinearRegionDetector.hh>
#include <FeatureDetector/BlobDetectorDOM.hh>
#include <Base/ImageUtils/ImageDraw.hh>
#include <Base/Image/ImageConvert.hh>
#include <Base/Image/ImageIO.hh>
using namespace BIAS;
using namespace std;
{
const int nump=p.size();
unsigned start[2];
unsigned radius=3;
for (int l=0; l<nump; l++){
if (!p[l].IsAtInfinity()){
start[0]=(unsigned)rint(p[l][0]);
start[1]=(unsigned)rint(p[l][1]);
}
}
}
int main(int argc, char *argv[])
{
int argind = 1;
if (argc-argind<1 || argind<1){
cerr << argv[0] << " <im1> [ <im2> <im3> ... ] \n";
return -2;
}
for (int imgCount=argind; imgCount<argc; imgCount++){
BIASERR("error loading image "<<argv[imgCount] << " is storage type unsigned char?" << endl);
return -1;
} else {
cerr << "read "<<argv[imgCount]<<endl;
}
BIASERR("could not convert to grey value image");
}
cout << "Constant Region Detection..."<<endl;
vector<HomgPoint2D> points2d;
vector<Vector3<unsigned char> > colors;
regionDetector.
Detect(ucim, points2d, colors,
true);
cout << "found " << points2d.size() << " constant regions " << endl;
Draw(result, points2d);
ostringstream name;
name << "constantRegions-"<<setw(4)<<setfill('0')<<imgCount-argind<<".mip";
cout << "name " << name.str() << endl << flush;
cout << "Linear Region Detection..."<<endl;
vector<QUAL> quality;
points2d.clear();
linDet.
Detect(greyim, points2d, quality, NULL);
result = ucim;
Draw(result, points2d);
ostringstream name2;
name2 << "linearRegions-"<<setw(4)<<setfill('0')<<imgCount-argind<<".mip";
cout << "name " << name2.str() << endl << flush;
cout << "Blob Region Detection..."<<endl;
vector<BIAS::BIASBlob> blobs;
blobDetector.
Detect(ucim, blobs);
unsigned char* color = new unsigned char[3];
color[0] = 255;
color[1] = 255;
color[2] = 255;
result = ucim;
delete color;
ostringstream name3;
name3 << "blobRegions-"<<setw(4)<<setfill('0')<<imgCount-argind<<".mip";
cout << "name3 " << name3.str() << endl << flush;
}
return 0;
}