描述匹配局部强度值

步骤:
1.定义检测器

2.检测关键点

3.提取描述子

设立mat类

使用feature2d::compute(src,keypoint,descriptors//产生兴趣点的结果是一个矩阵,行数等于关键点容器元素个数)

detectandcompute(image,noarray,keypoint,descriptors)//计算兴趣点与描述子

检测器与描述子可以任意搭配

4.构造匹配器

bfmatcher::

调用该类的match函数

match(descriptors1,descriptors2,matches//dmatch类)

优化

1.交叉检查匹配项:matcher2(norm_l2//度量差距,true//交叉检测标志)

2.比率检验法:在上一个方法基础上,只找到n个最佳匹配项

    

 

   3.匹配差值阈值化

  

matcher.radiusmatch(descriptors1,descriptors2,vector<vector<dmatch>> match,maxdist//阈值)

 

5.匹配两图像的描述子

posted @ 2021-05-10 12:38  KAVEI  阅读(63)  评论(0编辑  收藏  举报