Overview
TheORBmatcher class provides various strategies for matching ORB features between frames and keyframes. It supports projection-based matching, Bag-of-Words (BoW) matching, and Sim3-based matching for different SLAM tasks.
Header: include/ORBmatcher.h
Constructor
ORBmatcher
nnratio- Nearest neighbor ratio for Lowe’s ratio test (default: 0.6)checkOri- Whether to check feature orientation consistency (default: true)
Descriptor Distance
DescriptorDistance
a- First ORB descriptor (256-bit binary)b- Second ORB descriptor (256-bit binary)
Projection-Based Matching
SearchByProjection (Local Map)
F- Current framevpMapPoints- Vector of map points to projectth- Search radius threshold (default: 3)bFarPoints- Whether to include far points (default: false)thFarPoints- Distance threshold for far points (default: 50.0)
SearchByProjection (Previous Frame)
CurrentFrame- Current frameLastFrame- Previous frameth- Search radius thresholdbMono- Whether using monocular mode
SearchByProjection (Relocalization)
CurrentFrame- Current framepKF- Reference keyframesAlreadyFound- Set of already matched map pointsth- Search radius thresholdORBdist- Maximum descriptor distance
SearchByProjection (Loop Detection)
pKF- Target keyframeScw- Sim3 transformation (similarity transform)vpPoints- Map points to projectvpMatched- Output matched map pointsth- Search radius thresholdratioHamming- Hamming distance ratio threshold (default: 1.0)
Bag-of-Words Matching
SearchByBoW (Frame)
pKF- Reference keyframeF- Current framevpMapPointMatches- Output vector of matched map points
- Constrains search to features in the same vocabulary node
- Efficient matching for relocalization
- Uses Bag-of-Words for candidate selection
SearchByBoW (KeyFrame)
pKF1- First keyframepKF2- Second keyframevpMatches12- Output vector of matched map points
Specialized Matching
SearchForInitialization
F1- First frameF2- Second framevbPrevMatched- Previous matched pointsvnMatches12- Output match indiceswindowSize- Search window size (default: 10)
SearchForTriangulation
pKF1- First keyframepKF2- Second keyframevMatchedPairs- Output matched feature pairsbOnlyStereo- Whether to only use stereo featuresbCoarse- Whether to use coarse matching (default: false)
SearchBySim3
pKF1- First keyframepKF2- Second keyframevpMatches12- Output matched map pointsS12- Sim3 transformation from KF1 to KF2th- Search radius threshold
Map Point Fusion
Fuse (Basic)
pKF- Target keyframevpMapPoints- Map points to fuseth- Search radius threshold (default: 3.0)bRight- Whether using right camera (default: false)
Fuse (Sim3)
pKF- Target keyframeScw- Sim3 camera-to-world transformationvpPoints- Map points to fuseth- Search radius thresholdvpReplacePoint- Output replacement map points
Constants
Usage Example
Matching Strategies
Projection-Based
- Projects 3D map points into image space
- Searches for matches in predicted locations
- Fast for tracking known map points
- Uses camera pose and point position
Bag-of-Words
- Accelerates matching using vocabulary tree
- Constrains search to same vocabulary node
- Efficient for large-scale matching
- Used in relocalization and loop detection
Epipolar Constraint
- Enforces geometric consistency
- Used for triangulation
- Reduces outliers
- Ensures 3D consistency
See Also
- ORBextractor - Feature extraction
- Frame - Frame representation
- KeyFrame - Keyframe with map points
- MapPoint - 3D map points