SIFTFeatureCalculator.h
Go to the documentation of this file.
00001 // ****************************************************************************
00002 // This file is part of the Integrating Vision Toolkit (IVT).
00003 //
00004 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
00005 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
00006 //
00007 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
00008 // All rights reserved.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are met:
00012 //
00013 // 1. Redistributions of source code must retain the above copyright
00014 //    notice, this list of conditions and the following disclaimer.
00015 //
00016 // 2. Redistributions in binary form must reproduce the above copyright
00017 //    notice, this list of conditions and the following disclaimer in the
00018 //    documentation and/or other materials provided with the distribution.
00019 //
00020 // 3. Neither the name of the KIT nor the names of its contributors may be
00021 //    used to endorse or promote products derived from this software
00022 //    without specific prior written permission.
00023 //
00024 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
00025 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00026 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00027 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
00028 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00029 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00030 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00031 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00032 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00033 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034 // ****************************************************************************
00035 // ****************************************************************************
00036 // Filename:  SIFTFeatureCalculator.h
00037 // Author:    Pedram Azad, Lars Paetzold
00038 // Date:      24.09.2008
00039 // ****************************************************************************
00040 
00041 #ifndef _SIFT_FEATURE_CALCULATOR__H_
00042 #define _SIFT_FEATURE_CALCULATOR__H_
00043 
00044 
00045 // ****************************************************************************
00046 // Includes
00047 // ****************************************************************************
00048 
00049 #include "Interfaces/FeatureCalculatorInterface.h"
00050 #include "DataStructures/DynamicArrayTemplatePointer.h"
00051 #include "DataStructures/DynamicArrayTemplate.h"
00052 #include <vector>
00053 
00054 
00055 // ****************************************************************************
00056 // Forward declarations
00057 // ****************************************************************************
00058 
00059 class CFeatureEntry;
00060 class CFloatMatrix;
00061 class CByteImage;
00062 struct Vec2d;
00063 
00064 
00065 // ****************************************************************************
00066 // Defines
00067 // ****************************************************************************
00068 
00069 #define MAX_SCALES      10
00070 
00071 
00072 
00073 // ****************************************************************************
00074 // CSIFTFeatureCalculator
00075 // ****************************************************************************
00076 
00081 class CSIFTFeatureCalculator : public CFeatureCalculatorInterface
00082 {
00083 public:
00084         // constructor
00085         CSIFTFeatureCalculator(float fThreshold = 0.05f, int nOctaves = 3);
00086 
00087         // destructor
00088         ~CSIFTFeatureCalculator();
00089   
00090         
00091         // public methods
00092         int CalculateFeatures(const CByteImage *pImage, CDynamicArray *pResultList, bool bManageMemory = true);
00093 
00094         // member access
00095         void SetThreshold(float fThreshold) { m_fThreshold = fThreshold;}
00096         void SetNumberOfOctaves(int nOctaves) { m_nOctaves = nOctaves; }
00097 
00098         float GetThreshold() { return m_fThreshold; }
00099         int GetNumberOfOctaves() { return m_nOctaves; }
00100 
00101         // public static methods
00102         static void InitializeVariables();
00103         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);
00104         static void CreateSIFTDescriptors(const CByteImage *pImage, CDynamicArray *pResultList, float x, float y, float scale = 1.0f, bool bManageMemory = true, bool bPerform80PercentCheck = true);
00105         static void CreateSIFTDescriptors(const CByteImage *pImage, CDynamicArrayTemplatePointer<CFeatureEntry> &resultList, float x, float y, float scale = 1.0f, bool bPerform80PercentCheck = true);
00106 
00107 
00108 private:
00109         // private methods
00110         static void DetermineDominatingOrientations(const CFloatMatrix *pAngleMatrix, const CFloatMatrix *pMagnitudeMatrix, CDynamicArrayTemplate<float> &orientations, bool bPerform80PercentCheck);
00111         void FindScaleSpaceExtrema(const CFloatMatrix *pImage, float scale, int nOctave);
00112 
00113         // private attributes
00114         float m_fThreshold;
00115         int m_nOctaves;
00116 
00117         CDynamicArray *m_pResultList;
00118         bool m_bManageMemory;
00119 
00120         // static constants for internal use
00121         static float edgethreshold_;
00122         static float k_;
00123         static float diffk_;
00124         static float prescaledsigma_;
00125         static float diffsigma0_;
00126 
00127         static int SIFTPointers[256]; 
00128         static float SIFTWeights[256];
00129         static float SIFTOrientationWeights[256 * (MAX_SCALES + 1)];
00130         static float SIFTDescriptorWeights[256];
00131 
00132         static float SIFTDiffSigmas[MAX_SCALES];
00133         static float SIFTSigmas[MAX_SCALES];
00134         static float* SIFTGaussianFilters[MAX_SCALES];
00135         static int SIFTKernelRadius[MAX_SCALES];
00136 
00137         static int m_bInitialized;
00138 };
00139 
00140 
00141 
00142 #endif /* _SIFT_FEATURE_CALCULATOR__H_ */


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Thu Jun 6 2019 21:46:58