SIFTFeatureCalculator.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // This file is part of the Integrating Vision Toolkit (IVT).
3 //
4 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
5 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
6 //
7 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
8 // All rights reserved.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are met:
12 //
13 // 1. Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
19 //
20 // 3. Neither the name of the KIT nor the names of its contributors may be
21 // used to endorse or promote products derived from this software
22 // without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
25 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
28 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // ****************************************************************************
35 // ****************************************************************************
36 // Filename: SIFTFeatureCalculator.h
37 // Author: Pedram Azad, Lars Paetzold
38 // Date: 24.09.2008
39 // ****************************************************************************
40 
41 #ifndef _SIFT_FEATURE_CALCULATOR__H_
42 #define _SIFT_FEATURE_CALCULATOR__H_
43 
44 
45 // ****************************************************************************
46 // Includes
47 // ****************************************************************************
48 
52 #include <vector>
53 
54 
55 // ****************************************************************************
56 // Forward declarations
57 // ****************************************************************************
58 
59 class CFeatureEntry;
60 class CFloatMatrix;
61 class CByteImage;
62 struct Vec2d;
63 
64 
65 // ****************************************************************************
66 // Defines
67 // ****************************************************************************
68 
69 #define MAX_SCALES 10
70 
71 
72 
73 // ****************************************************************************
74 // CSIFTFeatureCalculator
75 // ****************************************************************************
76 
82 {
83 public:
84  // constructor
85  CSIFTFeatureCalculator(float fThreshold = 0.05f, int nOctaves = 3);
86 
87  // destructor
89 
90 
91  // public methods
92  int CalculateFeatures(const CByteImage *pImage, CDynamicArray *pResultList, bool bManageMemory = true);
93 
94  // member access
95  void SetThreshold(float fThreshold) { m_fThreshold = fThreshold;}
96  void SetNumberOfOctaves(int nOctaves) { m_nOctaves = nOctaves; }
97 
98  float GetThreshold() { return m_fThreshold; }
99  int GetNumberOfOctaves() { return m_nOctaves; }
100 
101  // public static methods
102  static void InitializeVariables();
103  static void CreateSIFTDescriptors(const CFloatMatrix *pImage, CDynamicArray *pResultList, float x, float y, float scale, float sigma, const float *pOrientationWeights, bool bManageMemory = true, bool bPerform80PercentCheck = true);
104  static void CreateSIFTDescriptors(const CByteImage *pImage, CDynamicArray *pResultList, float x, float y, float scale = 1.0f, bool bManageMemory = true, bool bPerform80PercentCheck = true);
105  static void CreateSIFTDescriptors(const CByteImage *pImage, CDynamicArrayTemplatePointer<CFeatureEntry> &resultList, float x, float y, float scale = 1.0f, bool bPerform80PercentCheck = true);
106 
107 
108 private:
109  // private methods
110  static void DetermineDominatingOrientations(const CFloatMatrix *pAngleMatrix, const CFloatMatrix *pMagnitudeMatrix, CDynamicArrayTemplate<float> &orientations, bool bPerform80PercentCheck);
111  void FindScaleSpaceExtrema(const CFloatMatrix *pImage, float scale, int nOctave);
112 
113  // private attributes
116 
119 
120  // static constants for internal use
121  static float edgethreshold_;
122  static float k_;
123  static float diffk_;
124  static float prescaledsigma_;
125  static float diffsigma0_;
126 
127  static int SIFTPointers[256];
128  static float SIFTWeights[256];
129  static float SIFTOrientationWeights[256 * (MAX_SCALES + 1)];
130  static float SIFTDescriptorWeights[256];
131 
132  static float SIFTDiffSigmas[MAX_SCALES];
133  static float SIFTSigmas[MAX_SCALES];
136 
137  static int m_bInitialized;
138 };
139 
140 
141 
142 #endif /* _SIFT_FEATURE_CALCULATOR__H_ */
int CalculateFeatures(const CByteImage *pImage, CDynamicArray *pResultList, bool bManageMemory=true)
static void CreateSIFTDescriptors(const CFloatMatrix *pImage, CDynamicArray *pResultList, float x, float y, float scale, float sigma, const float *pOrientationWeights, bool bManageMemory=true, bool bPerform80PercentCheck=true)
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:5308
Base class for the representation of local features.
Definition: FeatureEntry.h:72
CSIFTFeatureCalculator(float fThreshold=0.05f, int nOctaves=3)
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Definition: ByteImage.h:80
static float SIFTDiffSigmas[MAX_SCALES]
void FindScaleSpaceExtrema(const CFloatMatrix *pImage, float scale, int nOctave)
GLenum GLint x
Definition: glext.h:3125
Data structure for the representation of a matrix of values of the data type float.
Definition: FloatMatrix.h:56
static float SIFTOrientationWeights[256 *(MAX_SCALES+1)]
void SetNumberOfOctaves(int nOctaves)
static float SIFTSigmas[MAX_SCALES]
static float * SIFTGaussianFilters[MAX_SCALES]
void SetThreshold(float fThreshold)
Class for computing SIFT features in a CByteImage.
GLenum GLint GLint y
Definition: glext.h:3125
Data structure for the representation of a 2D vector.
Definition: Math2d.h:82
static float SIFTDescriptorWeights[256]
static void DetermineDominatingOrientations(const CFloatMatrix *pAngleMatrix, const CFloatMatrix *pMagnitudeMatrix, CDynamicArrayTemplate< float > &orientations, bool bPerform80PercentCheck)
static int SIFTKernelRadius[MAX_SCALES]
#define MAX_SCALES


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:28