Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ASTDETECTOR_H
00020 #define ASTDETECTOR_H
00021
00022 #include <vector>
00023 #include <iostream>
00024
00025 struct CvPoint;
00026
00027 namespace agast{
00028
00029 class AstDetector
00030 {
00031 public:
00032 AstDetector():xsize(0),ysize(0),b(-1) {}
00033 AstDetector(int width, int height, int thr):xsize(width),ysize(height),b(thr) {}
00034 virtual ~AstDetector(){;}
00035 virtual void detect(const unsigned char* im, std::vector<CvPoint>& corners_all)=0;
00036 virtual int get_borderWidth()=0;
00037 void nms(const unsigned char* im,
00038 const std::vector<CvPoint>& corners_all, std::vector<CvPoint>& corners_nms);
00039 void processImage(const unsigned char* im,
00040 std::vector<CvPoint>& keypoints_nms) {
00041 std::vector<CvPoint> keypoints;
00042 detect(im,keypoints);
00043 nms(im,keypoints,keypoints_nms);}
00044 void set_threshold(int b_){b=b_;}
00045 void set_imageSize(int xsize_, int ysize_){xsize=xsize_; ysize=ysize_; init_pattern();}
00046 virtual int cornerScore(const unsigned char* p, bool ignorePattern=false)=0;
00047
00048 protected:
00049 virtual void init_pattern()=0;
00050 void score(const unsigned char* i, const std::vector<CvPoint>& corners_all);
00051 void nonMaximumSuppression(const std::vector<CvPoint>& corners_all,
00052 std::vector<CvPoint>& corners_nms);
00053 std::vector<int> scores;
00054 std::vector<int> nmsFlags;
00055 int xsize, ysize;
00056 int b;
00057 };
00058
00059 }
00060
00061 #endif