You need to complete the following steps:
- Import the necessary modules:
import cv2import numpy as np
- Load an image and find its corners with cv2.cornerHarris:
img = cv2.imread('../data/scenetext01.jpg', cv2.IMREAD_COLOR)corners = cv2.cornerHarris(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY), 2, 3, 0.04)
- Process and display the result:
corners = cv2.dilate(corners, None)show_img = np.copy(img)show_img[corners>0.01*corners.max()]=[0,0,255]corners = cv2.normalize(corners, None, 0, 255, cv2.NORM_MINMAX).astype(np.uint8)show_img = np.hstack((show_img, cv2.cvtColor(corners, cv2.COLOR_GRAY2BGR)))cv2.imshow('Harris corner detector', show_img)if cv2.waitKey(0) == 27: cv2.destroyAllWindows()
- Create a FAST detector and apply it to the ...