34 #include <bias_config.h>
35 #include <FeatureDetector/CornerDetectorFoerstner.hh>
36 #include <FeatureDetector/CornerDetectorHarris.hh>
37 #include <FeatureDetector/CornerDetectorSusan.hh>
38 #include <FeatureDetector/CornerDetectorKLT.hh>
39 #include <FeatureDetector/LinearRegionDetector.hh>
40 #include <Base/Image/ColourRGB.hh>
41 #include <Base/ImageUtils/ImageDraw.hh>
42 #include <Base/Image/ImageConvert.hh>
43 #include <Base/Image/ImageIO.hh>
51 #ifdef BUILD_IMAGE_INT
52 #define StorageType unsigned char
53 #define KernelType int
55 #define StorageType unsigned char
56 #define KernelType float
61 #define StorageType float
62 #define KernelType float
69 const int nump=p.size();
73 for (
int l=0; l<nump; l++){
74 if (!p[l].IsAtInfinity()){
76 start[0]=(unsigned)rint(p[l][0]);
77 start[1]=(unsigned)rint(p[l][1]);
84 int main(
int argc,
char *argv[])
101 vector<HomgPoint2D> p;
105 if (argc-argind<1 || argind<1){
106 cerr << argv[0] <<
" [parameter] <im1> <im2> [ <im3> ... ] \n";
117 BIASERR(
"susan only implemented for unsigned char");
122 cout <<
"corner detector klt has been chosen " << endl;
130 cout <<
"corner detector harris has been chosen " << endl;
142 BIASERR(
"unknown corner detector type");
147 bool WantLinearRegionDetector =
false;
148 if (WantLinearRegionDetector) {
149 cout <<
"CornerDetector not used, detecting LINEAR regions ..."<<endl;
156 for (
int i=argind; i<argc; i++){
162 BIASERR(
"error loading image "<<argv[i]);
165 cerr <<
"read "<<argv[i]<<endl;
181 BIASERR(
"error converting image "<<argv[i]);
187 if (cd->
Detect(im, p, qual)!=0) {
188 cerr<<
"Corner detector indicated an error !"<<endl;
193 if (cdg->
Detect(im, p, qual)!=0) {
194 cerr<<
"Corner detector indicated an error !"<<endl;
198 cerr <<
"found "<<p.size()<<
" corners"<<endl;
200 for (
unsigned int r=0; r<p.size(); r++) {
201 cout <<setw(5)<<r<<
" : "<<p[r]<<
" with quality "<<qual[r]<<endl;
212 name <<
"corners-"<<setw(4)<<setfill(
'0')<<i-argind<<
".mip";
void AddDebugLevel(const long int lv)
Harris corner detector, detects grey value corners in images.
void SetMaxNumFeatures(const int maxnum)
static void Circle(BIAS::Image< StorageType > &dstImg, const int ¢erX, const int ¢erY, const int &radius=3, const BIAS::ColourRGB< StorageType > &colorRGB=ColourRGB< StorageType >(255, 255, 255), const int &thickness=1, const int &linetype=8, const int &shift=0)
OpenCV: Draws a circle.
try to detect linear regions (const gradient) in images, experimental code for testing ...
foerstner corner detector, detects grey value corners in images
virtual void SetMinCornerness(double min_cornerness)
sets minimum cornernes of detectable features
virtual int Detect(const Image< StorageType > &image, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality)
purely virtual interface definition
The Susan corner detector (oxford implementation, see license)
static int ConvertST(const BIAS::ImageBase &source, BIAS::ImageBase &dest, ImageBase::EStorageType targetST)
Function to convert the storage type of images e.g.
color values, 3 channels, order: red,green,blue
Computes the cornerness as the smaller eigenvalue of the structure tensor matrix. ...
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.
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...
purly virtual interface defining class for corner detectors
static int Convert(BIAS::ImageBase &source, BIAS::ImageBase &dest, enum BIAS::ImageBase::EColorModel targetColorModel, bool bPlanar=false)
main general conversion function, calls desired specialized functions, always initializes the destIma...
base class for all gradient based corner detectors
This is the base class for images in BIAS.
virtual int Detect(const Image< StorageType > &image, std::vector< HomgPoint2D > &p, std::vector< QUAL > &quality, std::vector< Matrix2x2< double > > *cov=NULL)
detect corners in a grey image