ViewDatabase2.h
Go to the documentation of this file.
00001 // *****************************************************************
00002 // Filename:  ViewDatabase2.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:      04.12.2007
00008 // *****************************************************************
00009 
00010 
00011 #ifndef _VIEW_DATABASE2_H_
00012 #define _VIEW_DATABASE2_H_
00013 
00014 
00015 // *****************************************************************
00016 // necessary includes
00017 // *****************************************************************
00018 
00019 #include <string>
00020 #include "DatabaseEntry.h"
00021 #include "DataStructures/DynamicArray.h"
00022 
00023 
00024 // *****************************************************************
00025 // forward class declarations
00026 // *****************************************************************
00027 
00028 class CFloatMatrix;
00029 class CByteImage;
00030 struct MyRegion;
00031 struct Vec3d;
00032 
00033 
00034 
00035 // *****************************************************************
00036 // CViewDatabase2
00037 // *****************************************************************
00038 
00039 class CViewDatabase2 : public CDynamicArrayElement
00040 {
00041 public:
00042         // constructor
00043         CViewDatabase2();
00044         
00045         // destructor
00046         ~CViewDatabase2();
00047         
00048         
00049         // public methods
00050         
00051         // for recognition
00052         bool Init(const char *pBasePath, const char* pPathPrefix = 0, std::string overrideClassName = "");
00053         bool InitRecognition();
00054         bool LearnTrainingData();
00055         int FindBestMatch(const CFloatMatrix *pInputData, float &error) const;
00056         bool GetView(int nGlobalIndex, int &nResultClass, int &nResultView);
00057         bool GetPose(int nView, Transformation3d &pose);
00058         
00059         // helpers
00060         static int GetNumberOfSamples(const char *pFileName, int &nInputDimension);
00061         static bool ReadData(const char *pFileName, float *pData, int nExpectedDimension);
00062         static void Normalize(const CByteImage *pInputImage, CByteImage *pOutputImage, const MyRegion &region);
00063         static void NormalizeIntensity(float *pData, int nLength);
00064         
00065         // member access
00066         int GetInputDimension() { return m_nInputDimension; }
00067         int GetTargetDimension() { return m_nTargetDimension; }
00068         int GetNumberOfSamples() { return m_nSamples; }
00069         const CDatabaseEntry* GetDatabaseEntry() const { return m_pDatabaseEntry; }
00070 
00071 
00072 
00073 private:
00074         // private methods
00075         void DeleteMatrices();
00076         bool ReadConfigurationFile(const char *pBasePath);
00077         bool WriteConfigurationFile(const char *pConfigurationFilename);
00078         
00079         
00080         // private attributes
00081         std::string m_sFullTransformationMatrixFilename;
00082         std::string m_sEigenvalueMatrixFilename;
00083         std::string m_sTransformationMatrixFilename;
00084         std::string m_sTrainingDataFilename;
00085         
00086         int m_nInputDimension;
00087         int m_nTargetDimension;
00088         int m_nSamples;
00089         
00090         std::string m_sConfigurationFilename;
00091         
00092         CFloatMatrix *m_pTransformationMatrix;
00093         CFloatMatrix *m_pTrainedData;
00094         
00095         CDatabaseEntry *m_pDatabaseEntry;
00096 };
00097 
00098 
00099 
00100 #endif /* _VIEW_DATABASE2_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