AstDetector.h
Go to the documentation of this file.
00001 //
00002 //    AstDetector - the interface class for the AGAST corner detector
00003 //
00004 //    Copyright (C) 2010  Elmar Mair
00005 //
00006 //    This program is free software: you can redistribute it and/or modify
00007 //    it under the terms of the GNU General Public License as published by
00008 //    the Free Software Foundation, either version 3 of the License, or
00009 //    (at your option) any later version.
00010 //
00011 //    This program is distributed in the hope that it will be useful,
00012 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 //    GNU General Public License for more details.
00015 //
00016 //    You should have received a copy of the GNU General Public License
00017 //    along with this program.  If not, see <http://www.gnu.org/licenses/>.
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 /* AGASTDETECTOR_H */


ptam
Author(s): Stephan Weiss, Markus Achtelik, Simon Lynen
autogenerated on Tue Jan 7 2014 11:12:22