问题描述
嗨,我已经实现了DMatch类,如下所示:
class DMatch:
def __init__(self,distance,queryIdx,trainIdx,imgIdx):
self.distance = float(distance)
self.queryIdx = int(queryIdx)
self.trainIdx = int(trainIdx)
self.imgIdx = int(imgIdx)
我计算了两张图片中两个描述符的距离,并找到了最佳匹配。
我想使用以下命令在cv2窗口上显示它:
img = cv2.drawMatches(img1,kp1,img2,kp2,topFeatures[:10],None,flags=2)
但是,我不断收到TypeError: Expected cv::DMatch for argument 'matches1to2'
我检查了类中的字段类型,包括了两个图片的关键点,并且将cv2 DMatch类中的所有字段(除了函数)都做了。
你们知道我可以解决什么吗?
预先谢谢你。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)