import cv2
import numpy as np
#harris
# bLockSize = 2
# ksize = 3
# k = e.e4
# Shi-Tomasi
maxCorners = 1000
ql = 0.01
minDistance = 10
img = cv2.imread('./image/dog.png')
#灰度化
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
corners = cv2.goodFeaturesToTrack(gray,maxCorners,ql, minDistance)
corners = np.int16(corners)
#Shi-Tomasi绘制角点
for i in corners:
x,y = i.ravel()
cv2.circle(img,(x,y), 3,(255,0,0),-1)
cv2.waitKey(0)
cv2.destroyAllWindows()