Fundamentals of Features and Corners

A lot of computer vision algorithms use features as their backbone. But what exactly is a feature?

The Shi-Tomasi Corner Detector

The Shi-Tomasi corner detector is based entirely on the Harris corner detector. However, one slight variation in a "selection criteria" made this detector much better than the original. It works quite well where even the Harris corner detector fails. So here's the minor change that Shi and Tomasi did to the original Harris corner detector.

The change

The Harris corner detector has a corner selection criteria. A score is calculated for each pixel, and if the score is above a certain value, the pixel is marked as a corner. The score is calculated using two eigenvalues. That is, you gave the two eigenvalues to a function. The function manipulates them, and gave back a score.

You can read more about how interesting windows in the Harris corner detector are selected.

Shi and Tomasi suggested that the function should be done away with. Only the eigenvalues should be used to check if the pixel was a corner or not.

The score for Harris corner detector was calculated like this (R is the score):

For Shi-Tomasi, it's calculated like this:

In their paper, Shi and Tomasi demonstrated experimentally that this score criteria was much better. If R is greater than a certain predefined value, it can be marked as a corner. Thus, the effect region for a point to be a corner is something like this:

  • Green: both λ1 and λ2 are greater than a certain value. Thus, this region is for pixels "accepted" as corners.
  • In the blue and gray regions, either λ1 or λ2 is less than he required minimum.
  • In the red region, both λ1 and λ2 are less than the required minimum. Compare the above with a similar graph for Harris corner detector... You'll see the blue and gray areas are equivalent to the "edge" areas. The red region is for "flat" areas. The green is for corners.


The Shi-Tomasi corner detector is a complete ripoff of the Harris corner detector, except for a minor change they did :P However, it is much better than the original corner detector, so people use it a lot more. Also, OpenCV implements the Shi-Tomasi corner detection algorithm.

More in the series

This tutorial is part of a series called Fundamentals of Features and Corners:

  1. Features: What are they?
  2. Harris Corner Detector
  3. Interesting windows in the Harris Corner Detector
  4. The Shi-Tomasi Corner Detector
  5. Subpixel Corners: Increasing accuracy

Utkarsh Sinha created AI Shack in 2010 and has since been working on computer vision and related fields. He is currently at Microsoft working on computer vision.