GSoC2011SfM
0.1
Google Summer of Code 2011: Structure from motion
|
A class used for matching points between two images. More...
#include <MatcherSparseFlow.h>
Public Member Functions | |
MatcherSparseFlow (const cv::Ptr< cv::DescriptorMatcher > &matcher, double dist_allowed=2.0) | |
virtual cv::Ptr< PointsMatcher > | clone (bool emptyTrainData=true) |
virtual void | match (cv::Ptr< PointsToTrack > queryPoints, std::vector< cv::DMatch > &matches, const std::vector< cv::Mat > &masks=std::vector< cv::Mat >()) |
virtual void | knnMatch (cv::Ptr< PointsToTrack > queryPoints, std::vector< std::vector< cv::DMatch > > &matches, int k, const std::vector< cv::Mat > &masks=std::vector< cv::Mat >(), bool compactResult=true) |
virtual void | radiusMatch (cv::Ptr< PointsToTrack > queryPoints, std::vector< std::vector< cv::DMatch > > &matches, float maxDistance, const std::vector< cv::Mat > &masks=std::vector< cv::Mat >(), bool compactResult=true) |
Static Public Member Functions | |
static cv::Ptr< PointsMatcher > | create (std::string match_algo, double dist_allowed=2.0) |
A class used for matching points between two images.
This class use first a feature based matcher to have guesses about optical flow and then use calcOpticalFlowPyrLK to find every match (and add points to other image if needed)
Definition at line 21 of file MatcherSparseFlow.h.
OpencvSfM::MatcherSparseFlow::MatcherSparseFlow | ( | const cv::Ptr< cv::DescriptorMatcher > & | matcher, |
double | dist_allowed = 2.0 |
||
) |
Construct a new point matcher using the name of the opticalflow algorithm.
matcher | the matching algo (see http://opencv.willowgarage.com/documentation/cpp/features2d_common_interfaces_of_descriptor_matchers.html) |
dist_allowed | in pixel, the threshold to know if a match is close enough to the predicted position |
Definition at line 22 of file MatcherSparseFlow.cpp.
Referenced by clone().
cv::Ptr< PointsMatcher > OpencvSfM::MatcherSparseFlow::clone | ( | bool | emptyTrainData = true | ) | [virtual] |
Clone the matcher.
emptyTrainData | IIf emptyTrainData is false the method create deep copy of the object, i.e. copies both parameters and train data. If emptyTrainData is true the method create object copy with current parameters but with empty train data.. |
Reimplemented from OpencvSfM::PointsMatcher.
Definition at line 29 of file MatcherSparseFlow.cpp.
static cv::Ptr<PointsMatcher> OpencvSfM::MatcherSparseFlow::create | ( | std::string | match_algo, |
double | dist_allowed = 2.0 |
||
) | [inline, static] |
Use this function to create a point matcher using the name of an opticalflow algorithm (see http://opencv.willowgarage.com/documentation/cpp/features2d_common_interfaces_of_descriptor_matchers.html)
match_algo | name of the wanted algorithm |
dist_allowed | in pixel, the threshold to know if a match is close enough to the predicted position |
Definition at line 41 of file MatcherSparseFlow.h.
void OpencvSfM::MatcherSparseFlow::knnMatch | ( | cv::Ptr< PointsToTrack > | queryPoints, |
std::vector< std::vector< cv::DMatch > > & | matches, | ||
int | k, | ||
const std::vector< cv::Mat > & | masks = std::vector<cv::Mat>( ) , |
||
bool | compactResult = true |
||
) | [virtual] |
Find the k best matches for each descriptor from a query set with train descriptors.
queryPoints | Query set of points and descriptors. |
matches | Mathes. Each matches[ i ] is k or less matches for the same query descriptor. |
k | Count of best matches will be found per each query descriptor ( or less if it’s not possible ). |
masks | specifying permissible matches between input query and train matrices of descriptors. |
compactResult | – It’s used when mask ( or masks ) is not empty. If compactResult is false matches vector will have the same size as queryDescriptors rows. If compactResult is true matches vector will not contain matches for fully masked out query descriptors. |
Reimplemented from OpencvSfM::PointsMatcher.
Definition at line 211 of file MatcherSparseFlow.cpp.
void OpencvSfM::MatcherSparseFlow::match | ( | cv::Ptr< PointsToTrack > | queryPoints, |
std::vector< cv::DMatch > & | matches, | ||
const std::vector< cv::Mat > & | masks = std::vector<cv::Mat>( ) |
||
) | [virtual] |
Find the k best matches for each descriptor from a query set with train descriptors.
queryPoints | Query set of points and descriptors. |
matches | Mathes. If some query descriptor ( keypoint ) masked out in mask no match will be added for this descriptor. So matches size may be less than query keypoints count. |
masks | The set of masks. Each masks[ i ] specifies permissible matches between input query keypoints and stored train keypointss from i-th image. |
Reimplemented from OpencvSfM::PointsMatcher.
Definition at line 41 of file MatcherSparseFlow.cpp.
Referenced by knnMatch(), and radiusMatch().
void OpencvSfM::MatcherSparseFlow::radiusMatch | ( | cv::Ptr< PointsToTrack > | queryPoints, |
std::vector< std::vector< cv::DMatch > > & | matches, | ||
float | maxDistance, | ||
const std::vector< cv::Mat > & | masks = std::vector<cv::Mat>( ) , |
||
bool | compactResult = true |
||
) | [virtual] |
Find the best matches for each query descriptor which have distance less than given threshold.
queryPoints | Query set of points and descriptors. |
matches | Each matches[ i ] is k or less matches for the same query descriptor. |
maxDistance | The threshold to found match distances. |
masks | specifying permissible matches between input query and train matrices of descriptors. |
compactResult | – It’s used when mask ( or masks ) is not empty. If compactResult is false matches vector will have the same size as queryDescriptors rows. If compactResult is true matches vector will not contain matches for fully masked out query descriptors. |
Reimplemented from OpencvSfM::PointsMatcher.
Definition at line 223 of file MatcherSparseFlow.cpp.