Skip to content

Instantly share code, notes, and snippets.

@pknowledge
Created October 2, 2019 22:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pknowledge/910d1230d3a2e56b32bf6dac8540c338 to your computer and use it in GitHub Desktop.
Save pknowledge/910d1230d3a2e56b32bf6dac8540c338 to your computer and use it in GitHub Desktop.
Shi_Tomasi_Corner_Detector_OpenCV
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