Skip to content

Shi-Tomasi and Harris corners

Find locations whose local gradients constrain motion in both image directions.

Try it on your image ↓

VISUAL WALKTHROUGHFeatures
REFERENCE INPUTTexture and corners

Corners change intensity in more than one direction; a long straight edge is less distinctive.

RESULTRetained keypoint locations

Only well-separated strong corners survive. These detector APIs do not produce descriptors.

STEP 03 / 03

Keep strong separated peaks; optionally refine them to subpixel positions.

Illustrative example. The stages explain the method; they are not a live OpenCV execution.

Try it on an image

YOUR IMAGE · REAL OPENCV

Experiment at pixel level

Open full lab ↗

Find strong, separated grayscale corners for tracking.

The engine loads on your first run. Your images stay in this browser.

Input448 × 320
OutputWaiting for a result

Scroll over either image to zoom at the pointer. Use the scrollbars to pan both views over the same relative area. Zoom is relative to the input; pixel coordinates belong to each image. Warps can change scene correspondence.

Pixel inspector RGBA · native values · matched scale · 9 × 9 output pixels
Hover to inspect. Click to pin a pixel.
Input
Select a pixel

Output
Select a pixel

Sample models and licenses

When to use it

Choose stable points for sparse optical flow or refine calibration corners.

How it works

  1. 01Accumulate local gradient products into a 2×2 matrix.
  2. 02Score both-direction intensity change using eigenvalues or a Harris response.
  3. 03Keep strong separated peaks; optionally refine them to subpixel positions.

Shi-Tomasi score = min(λ1, λ2)

What to tune

qualityLevel filters relative strength; minDistance spreads points; blockSize controls the neighbourhood.

Where it breaks down

A straight edge constrains movement across itself but poorly along itself. Corners can still disappear under occlusion or lighting changes.

TypeScript API

Open an entry for its exact overloads, parameter descriptions, result ownership and pinned upstream source.

All of these calls execute on the CPU. Native objects need explicit disposal. See matrices and ownership and build compatibility.