Corner detection is the computer vision technique that locates image points where intensity changes strongly in two different directions, such as the meeting point of two edges. These points, called corners or interest points, are distinctive enough to be found again in another image of the same scene, which makes them a foundation for feature matching, object tracking, image registration and 3D reconstruction.
Unlike an edge, which is ambiguous along its own length, a corner is well localized in both axes. That property lets algorithms anchor geometric reasoning to a sparse set of reliable points instead of processing every pixel.
How corner detection measures local image structure
Most classical detectors examine how the image intensity changes when a small window shifts in different directions. In a flat region, shifting the window changes almost nothing. Along an edge, shifting parallel to the edge changes little, while shifting across it changes the content substantially. At a corner, a shift in any direction produces a large change, and that is the signal a detector looks for.
The Harris detector formalizes this idea with the structure tensor, a 2×2 matrix built from summed products of the horizontal and vertical image gradients inside a weighted window. Its two eigenvalues describe the gradient energy along the two principal directions. Two small eigenvalues indicate a flat area, one large eigenvalue indicates an edge, and two large eigenvalues indicate a corner.
Because eigenvalue computation was costly, Harris and Stephens proposed the response R = det(M) – k * trace(M)^2, with an empirical constant k usually between 0.04 and 0.06. The Shi-Tomasi criterion instead uses the smaller eigenvalue directly, which tends to select corners that are better suited to tracking. The table below shows how the eigenvalues map to region types.
| Eigenvalue pattern | Region type | Detector response |
|---|---|---|
| Both small | Flat or uniform area | Near zero |
| One large, one small | Edge | Negative Harris response |
| Both large | Corner or textured point | Large positive response |
After the response map is computed, the detector applies a threshold to reject weak candidates and non-maximum suppression to keep only the local peak in each neighborhood. Without suppression, a single physical corner would yield a cluster of adjacent detections.
Main corner detection algorithms
Corner detectors differ mainly in speed, repeatability and invariance. Gradient-based methods are accurate but slower, intensity-comparison methods are extremely fast, and learned detectors trade simplicity for robustness under difficult conditions.
| Detector | Principle | Strength | Weakness |
|---|---|---|---|
| Moravec | Minimum intensity change over shifts | Simple, historical baseline | Anisotropic, noise sensitive |
| Harris | Structure tensor response | Rotation invariant, accurate | Not scale invariant |
| Shi-Tomasi | Minimum eigenvalue | Good for optical flow tracking | Not scale invariant |
| FAST | Contiguous ring of brighter or darker pixels | Very fast, real time | Noise sensitive, no orientation |
| ORB keypoints | FAST plus orientation over a pyramid | Fast with rotation handling | Weaker under strong blur |
| Learned detectors | Neural network keypoint heads | Robust to lighting changes | Needs GPU and training data |
FAST (Features from Accelerated Segment Test) tests a circle of 16 pixels around the candidate and accepts it when a contiguous arc, commonly 9 or 12 pixels, is all brighter or all darker than the center by a threshold. Its speed made it a standard choice in visual odometry and SLAM pipelines on embedded hardware.
Corners compared with edges and blob features
Corner detection is one member of a family of local feature detectors in computer vision. It is often confused with edge detection and with blob-based keypoint methods such as SIFT, yet each answers a different question about the image.
| Feature type | What it finds | Localization | Typical use |
|---|---|---|---|
| Corner | Two-direction intensity change | Precise in both axes | Tracking, calibration |
| Edge | One-direction intensity change | Precise across, ambiguous along | Boundaries, segmentation |
| Blob | Region differing from surroundings | Center of a scale-space extremum | Scale-invariant matching |
| Learned keypoint | Points scored by a network | Depends on the model | Robust matching |
A corner detector only finds points; it does not describe them. To match corners between images, a pipeline adds a descriptor, such as BRIEF, ORB or a patch around the point, and compares those descriptors. Confusing detection with description is a common source of design errors.
Invariance and parameter choices in practice
The practical quality of a detector depends on repeatability, the probability that the same physical corner is detected again after a change in viewpoint, lighting or scale. Harris and Shi-Tomasi are invariant to rotation and fairly robust to additive brightness changes, but they are not scale invariant: a sharp corner at one zoom level may look like a rounded curve at another.
The usual remedy is to run the detector on an image pyramid and record the scale at which each corner was found. Other important parameters include the gradient smoothing scale, the window size, the response threshold and the minimum distance between accepted corners.
| Parameter | Typical setting | Effect when increased |
|---|---|---|
| Window or block size | 3 to 7 pixels | Fewer, more stable corners |
| Harris constant k | 0.04 to 0.06 | Fewer edge-like detections |
| Response threshold | Relative to maximum response | Fewer, stronger corners |
| Minimum distance | 5 to 20 pixels | More even spatial spread |
| Maximum corner count | Hundreds to a few thousand | More coverage, more compute |
Limitations and common mistakes
Classical corner detection struggles with low texture, motion blur and image noise. A white wall offers almost no corners, while sensor noise in dark scenes creates false responses that do not repeat across frames. Repetitive patterns, such as windows on a facade, produce many corners that are individually valid but easy to mismatch.
- Skipping Gaussian smoothing before gradient computation, which amplifies noise.
- Using a global threshold on images with uneven lighting, which concentrates corners in bright areas.
- Omitting non-maximum suppression, which produces clustered duplicate detections.
- Expecting scale invariance from a single-scale Harris or Shi-Tomasi detector.
Learned keypoint detectors have reduced several of these problems, yet classical detectors remain widely used because they are deterministic, fast and easy to verify, which matters in calibration and embedded systems.
Stripped to the essentials
Corner detection teaches a computer to find the most recognizable points in a picture. Picture the corner of a window or the tip of a roof. These spots look different no matter which way you move a small magnifying glass around them.
A plain wall or a long straight line is hard to pin down, because many spots look the same. A corner is unique. Corners act like landmarks, so software can find the same points in the next photo or video frame and work out how things moved.
Where it is applied
An engineering team calibrating cameras for a warehouse robot photographs a printed checkerboard target from about 20 angles. Corner detection locates each inner checkerboard corner, and a refinement step adjusts every position to sub-pixel accuracy. From these points, the calibration software estimates the focal length and the lens distortion of each camera.
On the robot itself, a FAST detector extracts roughly 1,000 corners per frame at 30 frames per second on an embedded processor. Tracking those corners between frames lets the navigation system estimate how far the robot has moved. With accurate calibration and stable corners, the team keeps position drift to a few centimeters over a 50-meter aisle, which is good enough for the robot to dock reliably at charging stations.