Computer Vision Feature Detection

A feature is a distinctive part of an image — a corner, a blob, a line — that a computer can reliably find across different photos of the same scene. Feature detection locates these reliable spots so that the computer can track, match, or compare images.

Why Features Matter

Imagine matching two photos of the same building taken from different angles. You cannot compare them pixel by pixel — everything shifts. Instead, you find distinctive points (a sharp window corner, the tip of a spire) that appear in both photos, and match those. This is how image stitching, object tracking, and 3D reconstruction all work.

Good vs. Bad Features

GOOD FEATURES (easy to find again):
  → Sharp corners (the tip of a letter "A")
  → Isolated blobs (a dark dot on a bright background)
  → Intersection points (crossroads in a map)

BAD FEATURES (hard to relocate):
  → Points on flat color regions (the middle of a blank wall)
  → Points on a plain edge (anywhere along a long straight line)
  → Points in heavily blurred areas

A corner is good because it is unique in two directions.
A point on a flat edge is ambiguous — it could be anywhere along that edge.

The Harris Corner Detector

Harris Corner Detection finds corners by checking how much the image patch changes when you shift it in any direction. A flat region barely changes in any direction. An edge changes a lot in one direction but not the other. A corner changes a lot in every direction — making it a reliable feature.

Harris: Three Types of Image Patches

FLAT REGION:
  Move the patch in any direction → appearance barely changes.
  Harris score: LOW → Not a feature.

  ████████
  ████████   ← No variation, looks same everywhere
  ████████

EDGE:
  Move the patch along the edge → no change.
  Move perpendicular to the edge → big change.
  Harris score: MEDIUM → Not reliable.

  ████░░░░
  ████░░░░   ← Same along the line, different across it
  ████░░░░

CORNER:
  Move the patch in ANY direction → appearance changes.
  Harris score: HIGH → Reliable feature!

  ████░░░░
  ████░░░░   ← The corner point is unique in all directions
  ░░░░░░░░

Shi-Tomasi Corner Detector

Shi-Tomasi improves on Harris by using a slightly different scoring formula. It selects the top N strongest corners — making it ideal for applications like object tracking where you want a fixed number of good tracking points.

Harris vs. Shi-Tomasi

AspectHarrisShi-Tomasi
Score formuladet(M) − k × trace(M)²min(λ₁, λ₂)
OutputAll corners above a thresholdTop N best corners
Typical useGeneral detectionVideo object tracking

FAST: Features from Accelerated Segment Test

FAST finds corners by checking 16 pixels arranged in a circle around a candidate point. If enough consecutive pixels in that circle are much brighter or darker than the center, it is a corner. FAST is extremely quick — designed for real-time applications on limited hardware like mobile cameras.

FAST Circle Test

The 16-pixel circle around candidate pixel P:

              ●  ●  ●
           ●           ●
         ●               ●
         ●       P       ●
         ●               ●
           ●           ●
              ●  ●  ●

FAST rule: If 12 or more consecutive circle pixels are ALL
brighter than P+threshold (or ALL darker than P−threshold),
then P is a corner.

Fast check first: Test just pixels at N, S, E, W (top, bottom, left, right).
If fewer than 3 of those 4 satisfy the condition → skip P immediately.
→ Dramatically faster than Harris for real-time use.

Blob Detection: Finding Regions of Interest

While corner detectors find points, blob detectors find regions — groups of pixels that are distinctly different from their surroundings. A blob could be a coin on a table, a cell in a microscope image, or a ball on a sports field.

Laplacian of Gaussian (LoG) Blob Detection

Scale space approach:

Apply Gaussian blur at many different sizes (scales):
  Small σ  → Detects small blobs (tiny cells, small coins)
  Large σ  → Detects large blobs (organs, big objects)

At each scale, apply Laplacian (second derivative).
Pixel gets high LoG response when it sits at center of
a blob matching that scale's size.

Record the scale where the LoG response is maximum:
  → That scale tells you the blob's size.
  → That location tells you the blob's position.

Result: List of (x, y, size) for each detected blob.

SIFT Keypoints (Brief Introduction)

SIFT (Scale-Invariant Feature Transform) finds keypoints — locations that remain detectable even when the image is scaled, rotated, or the lighting changes. SIFT first detects blob-like regions across multiple scales, then selects the most stable ones. The next topic covers how SIFT and similar methods also describe what a keypoint looks like (not just where it is).

Feature Detectors: Quick Comparison

DetectorFindsSpeedBest Use
HarrisCornersMediumGeneral feature detection
Shi-TomasiBest N cornersMediumObject tracking
FASTCornersVery fastReal-time mobile apps
LoG / DoGBlobsSlowScale-invariant keypoints
SIFTStable keypointsSlowImage matching, 3D reconstruction

Real-World Applications of Feature Detection

  • Panorama stitching – Find matching corners in overlapping photos to merge them seamlessly.
  • Augmented reality markers – Detect the corners of AR tracking targets in real time.
  • Robot navigation – Track stable visual landmarks to determine the robot's position.
  • Medical cell counting – Detect each cell as a blob in microscope slides.
  • Sports tracking – Locate the ball (a moving blob) in video frames.

Key Takeaways

  • A feature is a distinctive, reliably detectable part of an image.
  • Corners are the most common type of feature — they change in all directions.
  • Harris Corner Detector scores each pixel by how much the patch changes when shifted.
  • FAST is designed for speed — it uses a circle test to find corners in real time.
  • Blob detectors find circular or oval regions different from their surroundings.
  • Feature detection enables image matching, tracking, and 3D reconstruction.

Leave a Comment

Your email address will not be published. Required fields are marked *