OpenCV 兴趣点匹配函数

来源:互联网 发布:淘宝美工兼职收费标准 编辑:程序博客网 时间:2024/05/21 10:37

DescriptorMatcher::match

Finds the best match for each descriptor from a query set.

C++: void DescriptorMatcher::match(const Mat& queryDescriptors, const Mat& trainDescriptors, vector<DMatch>& matches, const Mat& mask=Mat() ) const
C++: void DescriptorMatcher::match(const Mat& queryDescriptors, vector<DMatch>& matches, const vector<Mat>&masks=vector<Mat>() )
Parameters:
  • queryDescriptors – Query set of descriptors.
  • trainDescriptors – Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
  • matches – Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So,matches size may be smaller than the query descriptors count.
  • mask – Mask specifying permissible matches between an input query and train matrices of descriptors.
  • masks – Set of masks. Each masks[i] specifies permissible matches between the input query descriptors and stored train descriptors from the i-th image trainDescCollection[i].

In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.

0 0