GSoC2011SfM
0.1
Google Summer of Code 2011: Structure from motion
|
00001 #ifndef _GSOC_SFM_MATCHERSPARSEFLOW_H 00002 #define _GSOC_SFM_MATCHERSPARSEFLOW_H 1 00003 00004 #include "macro.h" //SFM_EXPORTS 00005 00006 #include "opencv2/features2d/features2d.hpp" 00007 #include <vector> 00008 00009 #include "config_SFM.h" //SEMAPHORE 00010 #include "PointsMatcher.h" 00011 00012 00013 namespace OpencvSfM{ 00014 00021 class SFM_EXPORTS MatcherSparseFlow : public PointsMatcher 00022 { 00023 double max_distance_; 00024 public: 00031 MatcherSparseFlow( const cv::Ptr<cv::DescriptorMatcher>& matcher, double dist_allowed = 2.0 ); 00032 00041 static cv::Ptr<PointsMatcher> create( std::string match_algo, double dist_allowed = 2.0 ) 00042 { 00043 return cv::Ptr<PointsMatcher>( new MatcherSparseFlow( 00044 cv::DescriptorMatcher::create( match_algo ), dist_allowed ) ); 00045 }; 00051 virtual cv::Ptr<PointsMatcher> clone( bool emptyTrainData=true ); 00060 virtual void match( cv::Ptr<PointsToTrack> queryPoints, 00061 std::vector<cv::DMatch>& matches, 00062 const std::vector<cv::Mat>& masks = std::vector<cv::Mat>( ) ); 00074 virtual void knnMatch( cv::Ptr<PointsToTrack> queryPoints, 00075 std::vector<std::vector<cv::DMatch> >& matches, int k, 00076 const std::vector<cv::Mat>& masks = std::vector<cv::Mat>( ), bool compactResult = true ); 00087 virtual void radiusMatch( cv::Ptr<PointsToTrack> queryPoints,std::vector<std::vector<cv::DMatch> >& matches, float maxDistance, 00088 const std::vector<cv::Mat>& masks = std::vector<cv::Mat>( ), bool compactResult = true ); 00089 }; 00090 00091 } 00092 00093 #endif