Generate similarity score in percentage from SIFT using opencv

南笙酒味 提交于 2019-12-20 12:11:30

问题


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.


回答1:


There is an opencv equivalent of vl_ubcmatch function in Matlab.

Here is the excerpt from opencv documentation.

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

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

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.



来源:https://stackoverflow.com/questions/37177349/generate-similarity-score-in-percentage-from-sift-using-opencv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!