Detecting corners in images

One of the most straightforward traditional features to find in an image are probably corners (locations where several edges meet). OpenCV provides at least two different algorithms to find corners in an image:

  • Harris Dorner Detection: Knowing that edges are areas with high-intensity changes in all directions, Harris and Stephens came up with a fast way of finding such locations. This algorithm is implemented as cv2.cornerHarris in OpenCV.
  • Shi-Tomasi Corner Detection: Shi and Tomasi have their own idea of what constitute good features to track, and they usually do better than Harris corner detection by finding the N strongest corners. This algorithm is implemented as cv2.goodFeaturesToTrack in OpenCV.

Harris ...

Get Machine Learning for OpenCV 4 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.