本文主要是介绍目标特征检测之SURF特征,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
SURF: speeded-up robust features是SIFT 的加速版
#!/usr/bin/env pythonimport cv2img = cv2.imread('chess.png')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)surf = cv2.SURF(400)
print surf.shape
kp, des = surf.detectAndCompute(gray, None)
print len(kp)
print surf.hessianThreshold
surf.hessianThreshold = 50000
kp, des = surf.detectAndCompute(gray, None)
print len(kp)img2 = cv2.drawKeypoints(gray,kp, None, (255,0,0), 4)cv2.imshow('surf', img2)
cv2.waitKey(0)
这篇关于目标特征检测之SURF特征的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!