您的位置:首页 > 其它

目标特征检测之FAST特征

2016-04-09 20:38 246 查看
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)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: