在opencv中,图像特征点匹配中匹配的对数和图像特征点匹配的正确率如何得出
由于图有问题,画的轮廓也有问题
img = cv2.imread("erode.png")
t,newi = cv2.threshold(gray,245,255,cv2.THRESH_BINARY)
hire,counters = cv2.findContours(newi,cv2.RETR_LIST,cv2.CHAIN_APPROX_SIMPLE)
n = len(hire)
countt=[]
print(len(hire))
for i in range(n):
#print('cc'+str(i),cv2.contourArea(hire[i]))
temp = np.zeros(img.shape,np.uint8)
countt.append(temp)
countt[i] = cv2.drawContours(countt[i],hire,i,(0,255,255),2)
cv2.imshow(str(i),countt[i])
换了一张图测试,效果好多了:
这篇文章介绍了使用SIFT算法检测图像中的特征点,并通过knn匹配来筛选出最近邻远优于次近邻的匹配作为good matches。文章给出了完整的代码和运行结果,并说明了SIFT特征的特点和检测过程。
参考链接:https://blog.csdn.net/qq_43279579/article/details/117687597