One of the most straightforward features to find in an image are probably corners. OpenCV provides at least two different algorithms to find corners in an image:
- Harris corner 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 areas. This algorithm is implemented as cv2.cornerHarris in OpenCV.
- Shi-Tomasi corner detection: Shi and Tomasi have their own idea of what are 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 corner detection works only on grayscale images, so we first ...