SegmentableDatabase.h
Go to the documentation of this file.
00001 // *****************************************************************
00002 // Filename:  SegmentableDatabase.h
00003 // Copyright: Pedram Azad, Chair Prof. Dillmann (IAIM),
00004 //            Institute for Computer Science and Engineering (CSE),
00005 //            University of Karlsruhe. All rights reserved.
00006 // Author:        Pedram Azad
00007 // Date:      03.12.2007
00008 // *****************************************************************
00009 
00010 
00011 #ifndef _SEGMENTABLE_DATABASE_H_
00012 #define _SEGMENTABLE_DATABASE_H_
00013 
00014 
00015 // *****************************************************************
00016 // necessary includes
00017 // *****************************************************************
00018 
00019 #include <string>
00020 #include <map>
00021 
00022 
00023 // *****************************************************************
00024 // forward class declarations
00025 // *****************************************************************
00026 
00027 class CByteImage;
00028 class CFloatMatrix;
00029 class CDynamicArray;
00030 class COpenGLVisualizer;
00031 class CObjectFinderStereo;
00032 class CStereoCalibration;
00033 class CDatabaseEntry;
00034 struct Transformation3d;
00035 struct Mat3d;
00036 struct Vec3d;
00037 
00038 
00039 
00040 // *****************************************************************
00041 // CSegmentableDatabase
00042 // *****************************************************************
00043 
00044 class CSegmentableDatabase
00045 {
00046 public:
00047         // constructor
00048         CSegmentableDatabase();
00049         
00050         // destructor
00051         ~CSegmentableDatabase();
00052         
00053         
00054         // public methods
00055                 
00056         // for recognition
00057         bool Init(const char *pConfigurationFilename, const char *pCameraParameterFilename, const char* pViewDataBasePathPrefix = 0);
00058         bool Init(const char *pConfigurationFilename, CStereoCalibration* pStereoCalibration, const char* pViewDataBasePathPrefix = 0);
00059     bool Init(CStereoCalibration* pStereoCalibration);
00060     bool AddClass(const std::string& classPath, const std::string& dataBasePrefix, std::string overrideClassName = "");
00061 
00062         void SetStereoCalibration(CStereoCalibration *pStereoCalibration);
00063         bool FindBestMatch(const CFloatMatrix *pInputData, const CByteImage *pMask, const Vec3d &initialPosition, int nSize,
00064                 Transformation3d &resultPose, float &fResultError, int &nResultClass, int &nResultView, float &fResultRatio, float &fResultCorrelation,
00065                 const char *pObjectName);
00066         
00067         // set recognition thresholds
00068         void SetRecognitionThresholds(float fSizeRatioThreshold, float fCorrelationThreshold);
00069         
00070         // set verbose mode
00071         void SetVerbose(bool bVerbose) { m_bVerbose = bVerbose; }
00072         
00073         // member access
00074         int GetNumberOfClasses();
00075         int GetInputDimension() { return m_nInputDimension; }
00076         const CDatabaseEntry* GetDatabaseEntry(int nClass);
00077 
00078         // pose correction
00079         bool CalculateCorrectedPosition(const char *pOIVFilePath, const Vec3d &triangulatedPosition, const Mat3d &orientation, const CByteImage *pMask, int nSize,
00080         Vec3d &correctedPosition, float &fRatio, float &fCorrelation);
00081         void CalculateCorrectedOrientation(const Vec3d &position, const Mat3d &orientation, Mat3d &resultOrientation);
00082         
00083         // static methods
00084         static bool DrawObjectFromFile(COpenGLVisualizer *pVisualizer, const char *pOIVFilePath, const Transformation3d &pose);
00085         static void Cleanup(); // call this method at the end of your programm to free memory for static objects
00086 
00087 
00088 private:
00089         // private methods
00090         int SimulateSize(const char *pOIVFilePath, const Transformation3d &pose, CByteImage *pObjectImage);
00091         bool InitDatabase(const char *pConfigurationFilename, const char* pViewDataBasePathPrefix = 0);
00092         
00093         // private attributes
00094         CDynamicArray *m_pViewDatabaseList;
00095         int m_nInputDimension;
00096 
00097         COpenGLVisualizer *m_pOpenGLVisualizer;
00098         CObjectFinderStereo *m_pObjectFinderStereo;
00099         
00100         float m_fSizeRatioThreshold;
00101         float m_fCorrelationThreshold;
00102         
00103         bool m_bVerbose;
00104 };
00105 
00106 
00107 
00108 #endif /* _SEGMENTABLE_DATABASE_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