我尝试使用SIFT描述符进行图像匹配。我正在计划将一个图像与另一个图像进行匹配。在
这是我试图与之匹配的代码
sift = cv2.xfeatures2d.SIFT_create()
kp_1, desc_1 = sift.detectAndCompute(original, None)
kp_2, desc_2 = sift.detectAndCompute(image_to_compare, None)
index_params = dict(algorithm=0, trees=5)
search_params = dict()
flann = cv2.FlannBasedMatcher(index_params, search_params)
matches = flann.knnMatch(desc_1, desc_2, k=2)
但我得到了以下错误:
^{pr2}$
在我的例子中,由于要加载的图像的位置不正确,出现了诸如断言失败之类的错误。请检查一下您的存储位置和代码。在
相关问题 更多 >
编程相关推荐