~ubuntu-branches/ubuntu/trusty/hugin/trusty-proposed

« back to all changes in this revision

Viewing changes to src/hugin_cpfind/localfeatures/KeyPointDetector.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Metzler
  • Date: 2011-01-06 14:28:24 UTC
  • mfrom: (1.1.9 upstream) (0.1.21 experimental)
  • Revision ID: james.westby@ubuntu.com-20110106142824-zn9lxylg5z44dynn
* Drop Cyril Brulebois from Uploaders. Thank you very much for your work.
* Bump package version. (rc3 was re-released as 2010.4.0).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* Copyright (C) 2007-2008 Anael Orlinski
 
3
*
 
4
* This file is part of Panomatic.
 
5
*
 
6
* Panomatic is free software; you can redistribute it and/or modify
 
7
* it under the terms of the GNU General Public License as published by
 
8
* the Free Software Foundation; either version 2 of the License, or
 
9
* (at your option) any later version.
 
10
 
11
* Panomatic is distributed in the hope that it will be useful,
 
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
* GNU General Public License for more details.
 
15
 
16
* You should have received a copy of the GNU General Public License
 
17
* along with Panomatic; if not, write to the Free Software
 
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
*/
 
20
 
 
21
#ifndef __lfeat_keypointdetector_h
 
22
#define __lfeat_keypointdetector_h
 
23
 
 
24
#include "Image.h"
 
25
#include "KeyPoint.h"
 
26
 
 
27
namespace lfeat {
 
28
 
 
29
class KeyPointInsertor
 
30
{
 
31
public: 
 
32
        virtual void operator()(const KeyPoint &k) = 0;
 
33
};
 
34
 
 
35
class LFIMPEX KeyPointDetector
 
36
{
 
37
public:
 
38
        // default constructor
 
39
        KeyPointDetector();
 
40
 
 
41
        // setters for various parameters
 
42
        inline void setMaxScales(unsigned int iMaxScales)       { _maxScales = iMaxScales; }
 
43
        inline void setMaxOctaves(unsigned int iMaxOctaves) { _maxOctaves = iMaxOctaves; }
 
44
        inline void setScoreThreshold(double iThreshold)        { _scoreThreshold = iThreshold; }
 
45
 
 
46
        // detect keypoints and put them in the insertor
 
47
        void detectKeypoints(Image& iImage, KeyPointInsertor& iInsertor);
 
48
        
 
49
private:
 
50
        
 
51
        // internal values of the keypoint detector
 
52
        
 
53
        // number of scales
 
54
        unsigned int                                    _maxScales;
 
55
        
 
56
        // number of octaves
 
57
        unsigned int                                    _maxOctaves;
 
58
 
 
59
        // detection score threshold
 
60
        double                                                  _scoreThreshold;
 
61
 
 
62
        // initial box filter size
 
63
        unsigned int                                    _initialBoxFilterSize;
 
64
 
 
65
        // scale overlapping : how many filter sizes to overlap
 
66
        // with default value 3 : [3,5,7,9,11][7,11,15,19,23][...
 
67
        unsigned int                                    _scaleOverlap;
 
68
 
 
69
        // some default values.
 
70
        const static double kBaseSigma;
 
71
 
 
72
        bool fineTuneExtrema(double *** iSH, unsigned int iX, unsigned int iY, unsigned int iS, 
 
73
                                                double& oX, double& oY, double& oS, double& oScore,
 
74
                                                unsigned int iOctaveWidth, unsigned int iOctaveHeight, unsigned int iBorder);
 
75
 
 
76
        bool calcTrace(Image& iImage, double iX, double iY, double iScale, int& oTrace);
 
77
 
 
78
        unsigned int            getFilterSize(unsigned int iOctave, unsigned int iScale);
 
79
        unsigned int            getBorderSize(unsigned int iOctave, unsigned int iScale);
 
80
 
 
81
};
 
82
 
 
83
}
 
84
 
 
85
#endif //__lfeat_keypointdetector_h