Opencv Corner Detection
OpenCV
Fast algorithm
Corner detection
Image processing
FAST object
fast_true.png
fast_false.png
This code utilizes OpenCV’s Fast algorithm to detect corners in an image, initializing the FAST object with default values and saving the results as ‘fast_true.png’ and ‘fast_false.png’. The Fast algorithm is a feature detection method that helps locate feature points or interest points in an image which can be useful for various computer vision tasks.
fast algorithm for corner detection
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
= cv.imread('blox.jpg',0) # `<opencv_root>/samples/data/blox.jpg`
img # Initiate FAST object with default values
= cv.FastFeatureDetector_create()
fast # find and draw the keypoints
= fast.detect(img,None)
kp = cv.drawKeypoints(img, kp, None, color=(255,0,0))
img2 # 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)) )
'fast_true.png', img2)
cv.imwrite(# Disable nonmaxSuppression
0)
fast.setNonmaxSuppression(= fast.detect(img, None)
kp print( "Total Keypoints without nonmaxSuppression: {}".format(len(kp)) )
= cv.drawKeypoints(img, kp, None, color=(255,0,0))
img3 'fast_false.png', img3) cv.imwrite(