Jafar
|
00001 /* $Id$ */ 00002 00003 #ifndef _GFM_MATCHER_HPP_ 00004 #define _GFM_MATCHER_HPP_ 00005 00006 #include "fdetect/InterestFeature.hpp" 00007 #include "fdetect/DetectionResult.hpp" 00008 00009 namespace jafar { 00010 namespace gfm { 00011 class MatchingResult; 00012 00013 class Matcher; 00020 class MatchSourceInfo { 00021 friend class Matcher; 00022 public: 00023 virtual ~MatchSourceInfo() { }; 00024 virtual void reinit() { } 00025 inline const jafar::fdetect::DetectionResult& points() const { return m_points; } 00026 friend std::ostream& operator <<(std::ostream& s, const MatchSourceInfo& p_); 00027 00028 protected: 00029 MatchSourceInfo( jafar::fdetect::DetectionResult points) : m_points(points) {} 00030 private: 00031 jafar::fdetect::DetectionResult m_points; 00033 friend class boost::serialization::access; 00034 template<class Archive> 00035 void serialize(Archive &ar, const unsigned int version) 00036 { 00037 ar & BOOST_SERIALIZATION_NVP(m_points); 00038 } 00039 }; 00040 00041 00046 class Matcher { 00047 public: 00048 virtual ~Matcher() { }; 00050 virtual MatchSourceInfo* initMatchSourceInfo( const jafar::fdetect::DetectionResult& pointsource ) 00051 { 00052 return new MatchSourceInfo(pointsource); 00053 } 00055 virtual jafar::gfm::MatchingResult computeMatch( MatchSourceInfo* refsourceinfo, MatchSourceInfo* matchsourceinfo) =0; 00056 }; 00057 } 00058 00059 namespace gfm_v2 { 00060 template<typename D> 00061 class MatchingResult; 00062 template <typename D> 00063 class Matcher; 00070 template< typename InterestFeatureT > 00071 class MatchSourceInfo 00072 { 00073 friend class gfm_v2::Matcher< InterestFeatureT >; 00074 public: 00075 typedef jafar::fdetect_v2::DetectionResult< InterestFeatureT > DetectionResult; 00076 virtual ~MatchSourceInfo() { }; 00077 virtual void reinit() { } 00078 const DetectionResult& points() const 00079 { 00080 return m_points; 00081 } 00082 friend std::ostream& operator <<(std::ostream& s, 00083 const MatchSourceInfo<InterestFeatureT>& p_) 00084 { 00085 s << p_.points(); 00086 return s; 00087 } 00088 00089 protected: 00090 MatchSourceInfo(const DetectionResult& points) : 00091 m_points(points) {} 00092 private: 00093 DetectionResult m_points; 00095 friend class boost::serialization::access; 00096 template<class Archive> 00097 void serialize(Archive &ar, const unsigned int version) 00098 { 00099 ar & BOOST_SERIALIZATION_NVP(m_points); 00100 } 00101 }; 00102 00103 00108 template< typename InterestFeatureT > 00109 class Matcher 00110 { 00111 public: 00112 // typedef jafar::fdetect_v2::DetectionResult< InterestFeatureT > DetectionResult; 00113 // typedef gfm_v2::MatchSourceInfo<InterestFeatureT> MatchSourceInfo; 00114 // typedef jafar::gfm_v2::MatchingResult<InterestFeatureT> MatchingResult; 00115 virtual ~Matcher() { }; 00117 virtual MatchSourceInfo<InterestFeatureT>* 00118 initMatchSourceInfo(const fdetect_v2::DetectionResult<InterestFeatureT>& pointsource) 00119 { 00120 return new MatchSourceInfo<InterestFeatureT>(pointsource); 00121 } 00123 virtual MatchingResult<InterestFeatureT> 00124 computeMatch( MatchSourceInfo<InterestFeatureT>* refsourceinfo, 00125 MatchSourceInfo<InterestFeatureT>* matchsourceinfo) =0; 00126 }; 00127 } 00128 } 00129 00130 #endif
Generated on Wed Oct 15 2014 00:37:20 for Jafar by doxygen 1.7.6.1 |