Created
October 2, 2019 22:27
-
-
Save pknowledge/910d1230d3a2e56b32bf6dac8540c338 to your computer and use it in GitHub Desktop.
Shi_Tomasi_Corner_Detector_OpenCV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cv2 as cv | |
img = cv.imread('pic1.png') | |
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) | |
corners = cv.goodFeaturesToTrack(gray, 100, 0.01, 10) | |
corners = np.int0(corners) | |
for i in corners: | |
x, y = i.ravel() | |
cv.circle(img, (x, y), 3, [255, 255, 0], -1) | |
cv.imshow('Shi-Tomasi Corner Detector', img) | |
if cv.waitKey(0) & 0xff == 27: | |
cv.destroyAllWindows() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment