网上找到例程了
可以用了
import cv2
img=cv2.imread('G:/python/36.jpg')
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# Here I set Hessian Threshold to 400 阈值越大能检测的特征就越少
surf=cv2.xfeatures2d.SURF_create(400)
# None 为mask参数
kp,des=surf.detectAndCompute(gray,None)
surf.setHessianThreshold(5000)
kp,des=surf.detectAndCompute(gray,None)
img2=cv2.drawKeypoints(img,kp,None,(0,255,0),4)
cv2.imshow('amdasi',img2)
cv2.waitKey(0) |