00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __lfeat_keypointdetector_h
00022 #define __lfeat_keypointdetector_h
00023
00024 #include "Image.h"
00025 #include "KeyPoint.h"
00026
00027 namespace lfeat
00028 {
00029
00030 class KeyPointInsertor
00031 {
00032 public:
00033 virtual void operator()(const KeyPoint& k) = 0;
00034 };
00035
00036 class LFIMPEX KeyPointDetector
00037 {
00038 public:
00039
00040 KeyPointDetector();
00041
00042
00043 inline void setMaxScales(unsigned int iMaxScales)
00044 {
00045 _maxScales = iMaxScales;
00046 }
00047 inline void setMaxOctaves(unsigned int iMaxOctaves)
00048 {
00049 _maxOctaves = iMaxOctaves;
00050 }
00051 inline void setScoreThreshold(double iThreshold)
00052 {
00053 _scoreThreshold = iThreshold;
00054 }
00055
00056
00057 void detectKeypoints(Image& iImage, KeyPointInsertor& iInsertor);
00058
00059 private:
00060
00061
00062
00063
00064 unsigned int _maxScales;
00065
00066
00067 unsigned int _maxOctaves;
00068
00069
00070 double _scoreThreshold;
00071
00072
00073 unsigned int _initialBoxFilterSize;
00074
00075
00076
00077 unsigned int _scaleOverlap;
00078
00079
00080 const static double kBaseSigma;
00081
00082 bool fineTuneExtrema(double** * iSH, unsigned int iX, unsigned int iY, unsigned int iS,
00083 double& oX, double& oY, double& oS, double& oScore,
00084 unsigned int iOctaveWidth, unsigned int iOctaveHeight, unsigned int iBorder);
00085
00086 bool calcTrace(Image& iImage, double iX, double iY, double iScale, int& oTrace);
00087
00088 unsigned int getFilterSize(unsigned int iOctave, unsigned int iScale);
00089 unsigned int getBorderSize(unsigned int iOctave, unsigned int iScale);
00090
00091 };
00092
00093 }
00094
00095 #endif //__lfeat_keypointdetector_h