计算机视觉OpenCV Harris角点检测和sift算法

Harris角点检测和sift算法

数学原理参考
https://mp.weixin.qq.com/s?__biz=MzI1ODEzMDQ3OQ==&mid=2247483887&idx=1&sn=de2eafd31ae3a4065480dacf8e0668e3&scene=19&token=1038729941&lang=zh_CN#wechat_redirect

算法实现计算机视觉OpenCV Harris角点检测和sift算法
代码
img=cv2.imread(‘chessboard.jpg’)

print(‘imgage.shape’,img.shape)

gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)

gray=np.float32(gray)#输入图像必须是 float32 ,最后一个参数在 0.04 到 0.05 之间

dst=cv2.cornerHarris(gray,2,3,0.04)

print(‘dst,shape’,dst.shape)

img[dst>0.01*dst.max()]=[0,0,255]

cv2.imshow(‘dst’,img)

cv2.waitKey(0)

cv2.destroyAllWindows()

sift算法

边缘检测算法