HoughSpace2D.h
Go to the documentation of this file.
00001 // *****************************************************************
00002 // Filename:  HoughSpace2D.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:      2005
00008 // *****************************************************************
00009 
00010 
00011 #ifndef _HOUGH_SPACE_2D_H_
00012 #define _HOUGH_SPACE_2D_H_
00013 
00014 
00015 // *****************************************************************
00016 // necessary includes
00017 // *****************************************************************
00018 
00019 #include "DataStructures/DynamicArray.h"
00020 
00021 
00022 // *****************************************************************
00023 // define
00024 // *****************************************************************
00025 
00026 
00027 
00028 // *****************************************************************
00029 // forward declarations
00030 // *****************************************************************
00031 
00032 class CFeatureEntry;
00033 class CByteImage;
00034 struct Mat3d;
00035 struct Vec2d;
00036 
00037 
00038 
00039 // *****************************************************************
00040 // CFeatureSet
00041 // *****************************************************************
00042 
00043 class CHoughSpace2D
00044 {
00045 public:
00046         // constructor
00047         CHoughSpace2D(int nImageWidth, int nImageHeight, float fScale);
00048 
00049         // CFeatureSet
00050         ~CHoughSpace2D();
00051 
00052         
00053         // public methods
00054         void InitNextRun();
00055         void Vote(const CFeatureEntry *pFeature, const CFeatureEntry *pMatchedFeature, const Vec2d &center);
00056         bool CheckAndDetermineHomography(Mat3d &A, Vec2d &centroid, int &nResultMatches, float &fResultError, CByteImage *pResultImage = 0);
00057         
00058         void SetRecognitionThresholds(int nMinValidFeatures, float fMaxError);
00059         
00060         void WriteHoughSpaceImage();
00061         
00062         const Vec2d* GetValidFeatures() { return m_pValidFeatures; }
00063         const Vec2d* GetMatchedFeatures() { return m_pMatchedFeatures; }
00064         int GetNumberOfValidFeatures() { return m_nValidFeatures; }
00065         
00066         void SetVerbose(bool bVerbose) { m_bVerbose = bVerbose; }
00067         
00068         
00069 private:
00070         // private class definitions
00071         class CHoughSpace2DBin
00072         {
00073         public:
00074                 CHoughSpace2DBin()
00075                 {
00076                         nID = 0;
00077                         nHits = 0;
00078                 }
00079                 
00080                 int nID;
00081                 unsigned short nHits;
00082         };
00083         
00084         class CFeaturePair : public CDynamicArrayElement
00085         {
00086         public:
00087                 CFeaturePair(const CFeatureEntry *pFeature_, const CFeatureEntry *pMatchedFeature_) : pFeature(pFeature_), pMatchedFeature(pMatchedFeature_)
00088                 {
00089                 }
00090                 
00091                 const CFeatureEntry *pFeature;
00092                 const CFeatureEntry *pMatchedFeature;
00093                 int offsets[6];
00094         };
00095 
00096         // private attributes
00097         CHoughSpace2DBin **m_ppHoughSpace;
00098         int m_nWidth;
00099         int m_nHeight;
00100         float m_fScale;
00101         int m_nCurrentID;
00102         int m_nMaxHits;
00103         int m_nBestOffset;
00104         float m_fBestScale;
00105         
00106         CDynamicArray *m_pPairList;
00107         
00108         Vec2d *m_pValidFeatures;
00109         Vec2d *m_pMatchedFeatures;
00110         int m_nValidFeatures;
00111         
00112         int m_nMinValidFeatures;
00113         float m_fMaxError;
00114         
00115         bool m_bVerbose;
00116 };
00117 
00118 
00119 
00120 #endif /* _HOUGH_SPACE_2D_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:57