Overview
Thefeatures2d 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)
- Scale invariant
- Rotation invariant
- 128-dimensional float descriptors
- Patented (free for research)
ORB (Oriented FAST and Rotated BRIEF)
- 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
| Algorithm | Speed | Descriptor | License | Best For |
|---|---|---|---|---|
| SIFT | Slow | Float 128D | Patented | Accuracy |
| ORB | Very Fast | Binary 32B | Free | Real-time |
| AKAZE | Fast | Binary/Float | Free | General |
| BRISK | Fast | Binary 64B | Free | Real-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
- Calib3D Module - Camera calibration using features
- Video Module - Object tracking with features
- Feature Detection Tutorial
