Fast: Feature from Accelerated Segment Test
适合在计算能力有限的设备上使用,其速度比SIFT 和SURF快,但是精度有限。
#!/usr/bin/env python
import cv2
img = cv2.imread('chess.png')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
fast = cv2.FastFeatureDetector()
kp = fast.detect(gray, None)
img2 = cv2.drawKeypoints(gray,kp, (255,0,0))
print "Threshold: ",fast.getInt('threshold')
print "nonmaxSuppression: ",fast.getBool('nonmaxSuppression')
print "neighborhood: ",fast.getInt('type')
print "Total Keypoint with nonmaxSuppression: ", len(kp)
cv2.imshow('fast', img2)
cv2.waitKey(0)