使用opencv从SIFT生成百分比相似度评分 [英] Generate similarity score in percentage from SIFT using opencv

查看:792
本文介绍了使用opencv从SIFT生成百分比相似度评分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在python(2.7.x)opencv(2.4.9)中使用SIFT比较两个图像之后,我一直试图找到一种方法来生成相似度得分(以%为单位).我只能找到在比赛之间画线的例子.我该如何进行.

I have been trying to find a way to generate similarity score ( in %) after comparing two images using SIFT in python (2.7.x) opencv (2.4.9). I was only able to find examples that draw lines between matches. How do I proceed with this.

推荐答案

在Matlab中有一个相当于vl_ubcmatch函数的opencv.

There is an opencv equivalent of vl_ubcmatch function in Matlab.

以下是 opencv文档.

# create BFMatcher object
bf = cv2.BFMatcher(cv2.NORM_HAMMING, crossCheck=True)

# Match descriptors.
matches = bf.match(des1,des2)

matches = bf. match (des1, des2)匹配两组描述符,并返回DMatch对象的列表.该DMatch对象具有四个属性:distance,trainIdx,queryIdx,imgIdx.这些返回值等效于vl_ubcmatch函数.

matches = bf. match (des1, des2) matches the two sets of descriptors and returns a list of DMatch objects. This DMatch object has four attributes: distance, trainIdx, queryIdx, imgIdx. These return values are equivalent of vl_ubcmatch function.

希望您会发现它对您有所帮助.

I hope you will find it helpful.

这篇关于使用opencv从SIFT生成百分比相似度评分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆