Skip to main content

Overview

The features2d module provides algorithms for detecting, describing, and matching 2D features in images. Features are distinctive points (keypoints) that can be reliably found across different views of the same scene.

Key Concepts

Feature Detection

Detecting distinctive points (corners, blobs) in images that are stable under various transformations.

Feature Description

Computing numerical descriptors for each keypoint that capture local appearance.

Feature Matching

Finding correspondences between features in different images.

Main Classes

Feature2D

Base class for feature detectors and descriptor extractors:

KeyPoint Structure

Feature Detectors

SIFT (Scale-Invariant Feature Transform)

Properties:
  • Scale invariant
  • Rotation invariant
  • 128-dimensional float descriptors
  • Patented (free for research)

ORB (Oriented FAST and Rotated BRIEF)

Properties:
  • Very fast
  • Binary descriptors (32 bytes)
  • Free to use
  • Good for real-time applications

BRISK

AKAZE

FAST Corner Detector

Descriptor Matchers

BFMatcher (Brute Force)

FLANN Matcher

KNN Matching

Complete Example

Algorithm Comparison

AlgorithmSpeedDescriptorLicenseBest For
SIFTSlowFloat 128DPatentedAccuracy
ORBVery FastBinary 32BFreeReal-time
AKAZEFastBinary/FloatFreeGeneral
BRISKFastBinary 64BFreeReal-time

Best Practices

Use ORB for Real-time

Fastest detector/descriptor, good for video

Use SIFT for Quality

Best accuracy but slower, patented

Apply Ratio Test

Filter matches using Lowe’s ratio test

Use Grayscale

Convert to grayscale for better performance

See Also