KeyPointDetector.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2007-2008 Anael Orlinski
00003 *
00004 * This file is part of Panomatic.
00005 *
00006 * Panomatic 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 2 of the License, or
00009 * (at your option) any later version.
00010 *
00011 * Panomatic 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 Panomatic; if not, write to the Free Software
00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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     // default constructor
00040     KeyPointDetector();
00041 
00042     // setters for various parameters
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     // detect keypoints and put them in the insertor
00057     void detectKeypoints(Image& iImage, KeyPointInsertor& iInsertor);
00058 
00059 private:
00060 
00061     // internal values of the keypoint detector
00062 
00063     // number of scales
00064     unsigned int                                        _maxScales;
00065 
00066     // number of octaves
00067     unsigned int                                        _maxOctaves;
00068 
00069     // detection score threshold
00070     double                                                      _scoreThreshold;
00071 
00072     // initial box filter size
00073     unsigned int                                        _initialBoxFilterSize;
00074 
00075     // scale overlapping : how many filter sizes to overlap
00076     // with default value 3 : [3,5,7,9,11][7,11,15,19,23][...
00077     unsigned int                                        _scaleOverlap;
00078 
00079     // some default values.
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

Generated on Wed Sep 17 01:25:40 2014 for Hugintrunk by  doxygen 1.3.9.1