ORB-SLAM Feature SLAM System
Track sharp corners, remember keyframes, and fix the map when you return. ORB-SLAM is the feature-based SLAM that made sparse maps reliable.
Why Does This Exist?
Visual odometry drifts because it forgets. ORB-SLAM exists to remember efficiently: it keeps a sparse map of triangulated ORB corners attached to keyframes, then reuses that map for tracking, local mapping, and loop repair. It became the reference sparse system because its three threads plus bag-of-words relocalization run in real time on a CPU.
This page covers the sparse feature pipeline. Direct pixel methods live in LSD-SLAM and DSO; inertial fusion lives in VINS. Loop repair detail is loop closure.
Think of It Like This
A hiker marking cairns on a trail
A hiker stacks small stone cairns at every junction and photographs each one. Between cairns she counts steps; when she recognizes an old cairn she fixes her whole step count at once instead of trusting the sum.
ORB corners are cairns, keyframes are the photos, and the bag-of-words lookup is recognizing an old stack. The analogy stops at lighting: cairns look the same all day while corner descriptors shift with viewpoint and blur.
How It Actually Works
Tracking extracts about ORB features per frame, matches them to the local map, and solves motion-only bundle adjustment for the current pose. Mapping triangulates new points from unmatched features, culls weak points that fail a visibility ratio test, and runs local bundle adjustment over connected keyframes in the covisibility graph. Loop closing converts each keyframe into a bag-of-words vector, finds candidates with high similarity, verifies with geometric checks, then runs pose-graph plus full bundle adjustment to distribute the correction.
Worked numbers
A corridor run keeps keyframes and map points. Tracking matches points per frame with mean residual px. A loop candidate scores similarity against a threshold , verifies with inlier matches, and the correction shifts the far end by m, cutting end-to-end drift from percent to percent.
Code
def bow_similarity(a: dict[int, float], b: dict[int, float]) -> float: common = set(a) & set(b) # shared visual words only return sum(a[w] * b[w] for w in common)
print(bow_similarity({1: 0.5, 2: 0.3}, {1: 0.5, 3: 0.4})) # -> 0.25Watch Out For
Running ORB in textureless corridors
Blank walls yield under features where the system wants hundreds, so tracking falls back to motion prediction and then loses. The symptom is repeated relocalization prompts in white hallways. Add keyframes aggressively, widen the search window briefly, or fuse depth or inertial data instead of trusting corners alone.
The Quick Version
- ORB-SLAM is a sparse feature SLAM built on ORB corners and keyframes.
- Tracking solves motion-only bundle adjustment against the local map.
- Mapping triangulates, culls, and refines through the covisibility graph.
- Bag-of-words loop closure finds revisits and triggers global correction.
- Typical indoor drift falls near percent after loop repair.
- Textureless scenes starve the feature front end first.