TexturedObjectDatabase.h
Go to the documentation of this file.
1 // *****************************************************************
2 // Filename: TexturedObjectDatabase.h
3 // Copyright: Pedram Azad, Chair Prof. Dillmann (IAIM),
4 // Institute for Computer Science and Engineering (CSE),
5 // University of Karlsruhe. All rights reserved.
6 // Author: Pedram Azad
7 // Date: 2006
8 // *****************************************************************
9 
10 
11 #ifndef _TEXTURED_OBJECT_DATABASE_H_
12 #define _TEXTURED_OBJECT_DATABASE_H_
13 
14 
15 // *****************************************************************
16 // necessary includes
17 // *****************************************************************
18 
19 #include "Features/FeatureEntry.h"
22 #include <string>
23 
24 
25 // *****************************************************************
26 // define
27 // *****************************************************************
28 
29 #define MAXIMUM_NUMBER_OF_CLASSES 50
30 
31 
32 // *****************************************************************
33 // forward declarations
34 // *****************************************************************
35 
36 class CDynamicArray;
37 class CByteImage;
39 class CHoughSpace2D;
40 class CStereoMatcher;
41 class CStereoCalibration;
42 class CKdTree;
43 struct Object3DEntry;
44 
45 
46 
47 
48 // *****************************************************************
49 // CTexturedObjectDatabase
50 // *****************************************************************
51 
53 {
54 public:
55  // constructor
56  CTexturedObjectDatabase(int nImageWidth, int nImageHeight);
57 
58  // destructor
60 
61 
62  // public methods
63 
64  // loads stereo calibration from file (optional; needed for 3d localization only)
65  bool LoadCameraParameters(const char *pFileName);
66  void InitCameraParameters(CStereoCalibration *pStereoCalibration, bool bCloneCalibration);
67 
68  // loads database from configuration file
69  bool LoadDatabase(const char *pConfigurationFilename, const char* pDataFilePathPrefix = 0);
70 
71  // set thresholds
72  void SetRecognitionThresholds(int nMinValidFeatures, float fMaxError);
73 
74  // add feature set to database
75  bool AddFeatureSet(CTexturedFeatureSet *pFeatureSet);
76  bool AddClass(const std::string& sClassName, const std::string& sFeatureSetFileName);
77 
78  // remove feature set from database
79  bool RemoveFeatureSet(int nIndex);
80  bool RemoveFeatureSet(const char *pName);
81 
82  // high level method for analyzing features in a scene
83  int AnalyzeFeatures(CDynamicArray *pFeatures, CByteImage *pResultImage,
84  const CByteImage * const *ppInputImagesFor3DLocalization = 0,
85  const Vec2d *pInterestPoints = 0, int nInterestPoints = 0,
86  int nUseKdTree = 0, bool bInputImagesAreUndistorted = false,
87  const char *pObjectName = 0);
88 
89  // returns feature set for a given index
90  const CTexturedFeatureSet* GetFeatureSet(int nIndex);
91 
92  // returns number of objects in database
93  int GetSize();
94 
95 
96  // set methods
97  void SetVerbose(bool bVerbose);
98  void SetStereo(bool bStereo) { m_bLocalizeWithStereo = bStereo; }
99 
100  void SetCorrelationParameters(int nWindowSize, float fMinZ, float fMaxZ, float fThreshold)
101  {
102  m_nCorrelationWindowSize = nWindowSize;
103  m_fCorrelationMinZ = fMinZ;
104  m_fCorrelationMaxZ = fMaxZ;
105  m_fCorrelationThreshold = fThreshold;
106  }
107 
108 
109 private:
110  // private class definitions
112  {
113  public:
114  CFeatureMapEntry(const CFeatureEntry *pFeature_, const CFeatureEntry *pMatchedFeature_, const CTexturedFeatureSet *pFeatureSet_) :
115  pFeature(pFeature_), pMatchedFeature(pMatchedFeature_), pFeatureSet(pFeatureSet_)
116  {
117  }
118 
122  };
123 
124  // private methods
125  bool BuildKdTree(int nObjectIndex);
126  bool Localize3D(const Vec2d &p1, const Vec2d &p2, const Vec2d &p3, const Vec2d &p4,
127  const Vec3d &p1_3d, const Vec3d &p2_3d, const Vec3d &p3_3d, const Vec3d &p4_3d,
128  const Vec2d *pFeatures, int nFeatures, const CByteImage * const *ppImages,
129  CByteImage *pResultImage, Object3DEntry &entry, bool bInputImagesAreUndistorted);
130 
131  // private attributes
136 
139 
144 
146 
151 
153 
154 
155 public:
157 };
158 
159 
160 
161 #endif /* _OBJECT_DATABASE_H_ */
CFeatureMapEntry(const CFeatureEntry *pFeature_, const CFeatureEntry *pMatchedFeature_, const CTexturedFeatureSet *pFeatureSet_)
bool Localize3D(const Vec2d &p1, const Vec2d &p2, const Vec2d &p3, const Vec2d &p4, const Vec3d &p1_3d, const Vec3d &p2_3d, const Vec3d &p3_3d, const Vec3d &p4_3d, const Vec2d *pFeatures, int nFeatures, const CByteImage *const *ppImages, CByteImage *pResultImage, Object3DEntry &entry, bool bInputImagesAreUndistorted)
CDynamicArray ** m_ppObjectFeatureMap
Base class for the representation of local features.
Definition: FeatureEntry.h:72
Class for computing matches for individual points in stereo image pairs.
Definition: StereoMatcher.h:78
Data structure for the representation of a 3D vector.
Definition: Math3d.h:73
Data structure for the representation of 8-bit grayscale images and 24-bit RGB (or HSV) color images ...
Definition: ByteImage.h:80
void SetCorrelationParameters(int nWindowSize, float fMinZ, float fMaxZ, float fThreshold)
CStereoCalibration * m_pStereoCalibration
void InitCameraParameters(CStereoCalibration *pStereoCalibration, bool bCloneCalibration)
bool RemoveFeatureSet(int nIndex)
GLsizei const GLchar ** string
Definition: glext.h:3528
bool BuildKdTree(int nObjectIndex)
Camera model and functions for a stereo camera system.
bool LoadCameraParameters(const char *pFileName)
bool AddClass(const std::string &sClassName, const std::string &sFeatureSetFileName)
bool AddFeatureSet(CTexturedFeatureSet *pFeatureSet)
CTexturedObjectDatabase(int nImageWidth, int nImageHeight)
const CTexturedFeatureSet * GetFeatureSet(int nIndex)
int AnalyzeFeatures(CDynamicArray *pFeatures, CByteImage *pResultImage, const CByteImage *const *ppInputImagesFor3DLocalization=0, const Vec2d *pInterestPoints=0, int nInterestPoints=0, int nUseKdTree=0, bool bInputImagesAreUndistorted=false, const char *pObjectName=0)
Data structure for the representation of a 2D vector.
Definition: Math2d.h:82
void SetRecognitionThresholds(int nMinValidFeatures, float fMaxError)
bool LoadDatabase(const char *pConfigurationFilename, const char *pDataFilePathPrefix=0)
void SetVerbose(bool bVerbose)
std::vector< Object3DEntry > Object3DList
Data structure for handling of sets of features, represented as instances of CFeatureEntry (resp...


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