OpenCV  4.0.1
Open Source Computer Vision
Functions
Experimental 2D Features Matching Algorithm

Functions

void cv::xfeatures2d::matchGMS (const Size &size1, const Size &size2, const std::vector< KeyPoint > &keypoints1, const std::vector< KeyPoint > &keypoints2, const std::vector< DMatch > &matches1to2, std::vector< DMatch > &matchesGMS, const bool withRotation=false, const bool withScale=false, const double thresholdFactor=6.0)
 GMS (Grid-based Motion Statistics) feature matching strategy by [16] . More...
 

Detailed Description

This section describes the GMS (Grid-based Motion Statistics) matching strategy.

Function Documentation

§ matchGMS()

void cv::xfeatures2d::matchGMS ( const Size size1,
const Size size2,
const std::vector< KeyPoint > &  keypoints1,
const std::vector< KeyPoint > &  keypoints2,
const std::vector< DMatch > &  matches1to2,
std::vector< DMatch > &  matchesGMS,
const bool  withRotation = false,
const bool  withScale = false,
const double  thresholdFactor = 6.0 
)
Python:
matchesGMS=cv.xfeatures2d.matchGMS(size1, size2, keypoints1, keypoints2, matches1to2[, withRotation[, withScale[, thresholdFactor]]])

GMS (Grid-based Motion Statistics) feature matching strategy by [16] .

Parameters
size1Input size of image1.
size2Input size of image2.
keypoints1Input keypoints of image1.
keypoints2Input keypoints of image2.
matches1to2Input 1-nearest neighbor matches.
matchesGMSMatches returned by the GMS matching strategy.
withRotationTake rotation transformation into account.
withScaleTake scale transformation into account.
thresholdFactorThe higher, the less matches.
Note
Since GMS works well when the number of features is large, we recommend to use the ORB feature and set FastThreshold to 0 to get as many as possible features quickly. If matching results are not satisfying, please add more features. (We use 10000 for images with 640 X 480). If your images have big rotation and scale changes, please set withRotation or withScale to true.