Python使用opencv,有无最大关键抑制点区别
import numpy as np import cv2 as cv from matplotlib import pyplot as plt img = cv.imread('1.JPG',0) # Initiate FAST object with default values fast = cv.FastFeatureDetector_create() # find and draw the keypoints kp = fast.detect(img,None) img2 = cv.drawKeypoints(img, kp, None, color=(255,0,0)) # Print all default params print( "Threshold: {}".format(fast.getThreshold()) ) print( "nonmaxSuppression:{}".format(fast.getNonmaxSuppression()) ) print( "neighborhood: {}".format(fast.getType()) ) print( "Total Keypoints with nonmaxSuppression: {}".format(len(kp)) ) cv.imwrite('fast_true.png',img2) # Disable nonmaxSuppression fast.setNonmaxSuppression(0) kp = fast.detect(img,None) print( "Total Keypoints without nonmaxSuppression: {}".format(len(kp)) ) img3 = cv.drawKeypoints(img, kp, None, color=(255,0,0)) cv.imwrite('fast_false.png',img3)
先看看无最大抑制点

看看有最大抑制点

如果人生还有重来,那就不叫人生。

浙公网安备 33010602011771号