Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
trv_homographyFine.hpp
00001 #ifndef TRV_HOMOGRAPHYFINE_HPP
00002 #define TRV_HOMOGRAPHYFINE_HPP
00003 
00004 #include "traversability/trv_util.hpp"
00005 #include "traversability/trv_homography.hpp"
00006 #include "traversability/trv_homographyGeom.hpp"
00007 #include "traversability/traversabilityException.hpp"
00008 
00009 #include "kernel/jafarException.hpp"
00010 #include "jmath/jblas.hpp"
00011 #include "jmath/ublasExtra.hpp"
00012 #include "jmath/randomIntTmplt.hpp"     // random int for ransac estimation
00013 #include "jmath/linearSolvers.hpp"  // LU-decomposition
00014 
00015 #include "../libsLourakis/homest-1.2/homest.h"        // lourakis' robust homography estimator
00016 
00017 
00018 namespace jafar {
00019   namespace traversability {
00020     
00027     class HomographyFine : public Homography
00028     {
00029       private:
00030         // matches, interface with gfm: class MatchesContainer
00031         MatchesContainer* mMatches;
00032         
00033         // projection statistics
00034         jblas::vec mProjError;
00035         double mMeanProjError;
00036         double mStdProjError;
00037       
00038       public:
00039         HomographyFine ( void );
00040         HomographyFine ( const HomographyGeom &Hgeom );
00041         ~HomographyFine ( void );
00042         void printInfo ( void ) const;
00043         
00044         int setMatches ( MatchesContainer* matches ) {
00045           if (matches->nOfMatches()==0)
00046           {
00047             return 1;
00048           }
00049           // call copy constructor to perform deep copy of matchesContainer.
00050           // if only the reference is passed, the member mMatches will be 
00051           // changed as soon as the member mMatches of tracker is changed...
00052           mMatches = new MatchesContainer(*matches);
00053           // instead of
00054           // mMatches = matches;
00055           return 0;
00056         }
00057         MatchesContainer getMatches ( void ) { return *mMatches; }
00058         
00059         void estimate ( void );
00060         void estimateR ( void );
00061         void estimateRANSAC ( void );
00062         
00063         // is antiquated (obsolete): TODO: remove this function, but ensure that this is done in core
00064         void estimateWithGeom ( const jblas::mat33& H_C0C1_geom );
00065         
00066       public:
00067         // projection statistics
00068         double getMeanProjError ( void ) { return mMeanProjError; }
00069         double getStdProjError ( void ) { return mStdProjError; }
00070         void calcProjErrorStats ( const jblas::mat33 H01, double &mean, double &stdev );
00071         void sortOutMatches ( const jafar::image::Image &mask );
00072         
00073       private:
00074         template <class Mat> void calcA_i ( const double x0u, const double x0v, const double x1u, const double x1v, Mat &A_i, const double weight = 1.0 );
00075         void calcH4p ( const MatchesContainer *mc, const jblas::veci4 &idxVec, jblas::mat33 &H_C0C1 );
00076         void pointSelectionCriteria ( const int idx, const MatchesContainer* matches, jblas::veci4 &idxVec, int &featCnt, const double minDistSq, const double minCrossP );
00077     
00078     };  // class HomographyFine
00079   } // namespace traversability
00080 } // namespace jafar
00081 
00082 #endif
00083 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:29 for Jafar by doxygen 1.7.6.1
LAAS-CNRS