Matches two sets of key-points and descriptors. More...
#include <robustmatcher.hpp>
Public Member Functions | |
cv::Mat | match (std::vector< cv::KeyPoint > &keypoints1, cv::Mat &descriptors1, std::vector< cv::KeyPoint > &keypoints2, cv::Mat &descriptors2, std::vector< cv::DMatch > &matches, bool doRansacTest=true, bool doRatioTest=false, bool refineF=false) |
Match feature points using symmetry test and RANSAC. | |
cv::Mat | ransacTest (const std::vector< cv::DMatch > &matches, const std::vector< cv::KeyPoint > &keypoints1, const std::vector< cv::KeyPoint > &keypoints2, std::vector< cv::DMatch > &outMatches) |
Identify good matches using RANSAC. | |
int | ratioTest (std::vector< std::vector< cv::DMatch > > &matches) |
Clear matches for which NN ratio is greater than threshold The corresponding entries in the vector of matches are cleared. | |
RobustMatcher (void) | |
Constructor. | |
void | symmetryTest (const std::vector< std::vector< cv::DMatch > > &matches1, const std::vector< std::vector< cv::DMatch > > &matches2, std::vector< cv::DMatch > &symMatches) |
Checks that matches are present both ways. | |
Private Attributes | |
double | confidence_ |
double | distance_ |
cv::BFMatcher | matcher_ |
float | ratio_ |
bool | refineF_ |
Matches two sets of key-points and descriptors.
Definition at line 53 of file robustmatcher.hpp.
RobustMatcher::RobustMatcher | ( | void | ) | [inline] |
Constructor.
Definition at line 58 of file robustmatcher.hpp.
cv::Mat RobustMatcher::match | ( | std::vector< cv::KeyPoint > & | keypoints1, |
cv::Mat & | descriptors1, | ||
std::vector< cv::KeyPoint > & | keypoints2, | ||
cv::Mat & | descriptors2, | ||
std::vector< cv::DMatch > & | matches, | ||
bool | doRansacTest = true , |
||
bool | doRatioTest = false , |
||
bool | refineF = false |
||
) | [inline] |
Match feature points using symmetry test and RANSAC.
[in] | keypoints1 | Set of key-points from first image |
[in] | descriptors1 | Set of feature descriptors from first image |
[in] | keypoints2 | Set of key-points from second image |
[in] | descriptors2 | Set of feature descriptors from second image |
[out] | matches | Resulting robust matches between the first and second images |
[in] | doRansacTest | If true, perform RANSAC test to matches |
[in] | doRatioTest | If true, perform ratio test to matches |
[in] | refineF | If true, refine fundamental matrix |
Definition at line 79 of file robustmatcher.hpp.
cv::Mat RobustMatcher::ransacTest | ( | const std::vector< cv::DMatch > & | matches, |
const std::vector< cv::KeyPoint > & | keypoints1, | ||
const std::vector< cv::KeyPoint > & | keypoints2, | ||
std::vector< cv::DMatch > & | outMatches | ||
) | [inline] |
Identify good matches using RANSAC.
[in] | matches | Input matches between images 1 and 2 |
[in] | keypoints1 | Key-points from image 1 |
[in] | keypoints2 | Key-points from image 2 |
[out] | outMatches | Surviving matches after RANSAC test |
Definition at line 187 of file robustmatcher.hpp.
int RobustMatcher::ratioTest | ( | std::vector< std::vector< cv::DMatch > > & | matches | ) | [inline] |
Clear matches for which NN ratio is greater than threshold The corresponding entries in the vector of matches are cleared.
matches | Vector of matches |
Definition at line 122 of file robustmatcher.hpp.
void RobustMatcher::symmetryTest | ( | const std::vector< std::vector< cv::DMatch > > & | matches1, |
const std::vector< std::vector< cv::DMatch > > & | matches2, | ||
std::vector< cv::DMatch > & | symMatches | ||
) | [inline] |
Checks that matches are present both ways.
[in] | matches1 | Matched points in one direction |
[in] | matches2 | Matched points in the opposite direction |
[out] | symMatches | Output symmetrical matches |
Definition at line 151 of file robustmatcher.hpp.
double RobustMatcher::confidence_ [private] |
Confidence level (probability)
Definition at line 262 of file robustmatcher.hpp.
double RobustMatcher::distance_ [private] |
Min distance to epipolar in RANSAC
Definition at line 261 of file robustmatcher.hpp.
cv::BFMatcher RobustMatcher::matcher_ [private] |
Bruteforce matcher
Definition at line 263 of file robustmatcher.hpp.
float RobustMatcher::ratio_ [private] |
Max ratio between 1st and 2nd nearest neighbor
Definition at line 259 of file robustmatcher.hpp.
bool RobustMatcher::refineF_ [private] |
If true the F matrix will be refined
Definition at line 260 of file robustmatcher.hpp.