fast检测器 (编译不过kp = fast.detect(img , None)类型不对先记录下来以后查看源码)

本文通过使用Python的OpenCV库,详细介绍了FAST特征检测器的工作原理及应用。演示了如何读取图片,显示图片轮廓,并利用FAST算法检测关键点。同时,展示了非极大值抑制对关键点数量的影响,对比了其开启和关闭时的区别。
import cv2
import numpy as np
from matplotlib import pyplot as plt



img = cv2.imread('left08.jpg',0)
cv2.imshow("contours", img)
fast = cv2.FastFeatureDetector()
print(type(fast))
kp = fast.detect(img , None)
img2 = cv2.drawKeypoints(img, kp, color=(255, 0, 0))
print("Threshold: ", fast.getInt('threshold'))
print("nonmaxSuppression:: ", fast.getBool('nonmaxSuppression'))
print("neighborhood:: ", fast.getInt('type'))
print("Total Keypoints with nonmaxSuppression:: ", len(kp))

cv2.imwrite('fast_true.png',img2)
kp = fast.detect(img,None)
print ("Total Keypoints without nonmaxSuppression: ", len(kp))
img3 = cv2.drawKeypoints(img, kp, color=(255,0,0))




#fast(src)
#cv.namedWindow("input image", cv.WINDOW_AUTOSIZE)

cv2.waitKey(0)

cv2.destroyAllWindows()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值