Shi-Tomasi and Harris corners
Find locations whose local gradients constrain motion in both image directions.
Corners change intensity in more than one direction; a long straight edge is less distinctive.
Accumulate local gradient products into a 2×2 matrix.
Score both-direction intensity change using eigenvalues or a Harris response.
Only well-separated strong corners survive. These detector APIs do not produce descriptors.
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
Experiment at pixel level
Find strong, separated grayscale corners for tracking.
The engine loads on your first run. Your images stay in this browser.
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
Select a pixel
Select a pixel
When to use it
Choose stable points for sparse optical flow or refine calibration corners.
How it works
- 01Accumulate local gradient products into a 2×2 matrix.
- 02Score both-direction intensity change using eigenvalues or a Harris response.
- 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.
Related methods
ORB features
Detect oriented corners across an image pyramid and describe them with compact binary tests.
SIFT features
Detect scale-space extrema and describe local gradient distributions around them.
AKAZE features
Find and describe features in a nonlinear scale space that preserves important boundaries.
BRISK features
Describe scale-space keypoints using intensity comparisons on concentric sampling rings.