Stereo visual odometry · KITTI · EuRoC · a real wheelchair

MetricVision

Rigid-rig stereo visual odometry with gated monocular depth priors and dynamic-object handling, from benchmarks to a wheelchair robot.

Soumo Roy · Mohammed Azif · Tashmoy Ghosh

The wheelchair robot with two RealSense cameras mounted on a mast Live VO debug view on a wheelchair recording: tracked features coloured by depth, stereo partners, the path against wheel odometry
The wheelchair rig and the live VO view: features coloured by depth, stereo partners on the same rectified row, the path against wheel odometry.

01 Overview

A stereo rig measures metric depth in every frame, yet most VO pipelines use the second camera only to triangulate. MetricVision treats the two cameras as one rigid body: one pose per frame explains both images through a 3-D residual \((u_L, v_L, u_R)\), weighted by each point's triangulation covariance and optimised with our own analytic-Jacobian Levenberg–Marquardt.

On top of that core we fuse every track's 3-D point over time, refine keyframes in a sliding-window bundle adjustment and close loops with place recognition. Two modules are new: gated monocular metric depth priors inside a stereo BA, and a class-agnostic geometric gate for moving and occluded points, combined with a semantic people/vehicle mask. A controlled benchmark compares five front ends inside one fixed back end, and the whole system runs live on our wheelchair as a ROS 2 node.

29.7 m → 6.3 mKITTI 00 ATE from back-end components alone (no loop closure)
1.8 mATE over 3.7 km with loop closure
1.18 %KITTI devkit drift without loop closure
23–25 fpslive on the wheelchair (640×480, 15 fps cameras)

02 Method

System overview: stereo front end, rigid-rig tracking, keyframe mapping, and the two new modules
Every frame: the stereo front end tracks features and the rigid-rig LM estimates the pose; landmarks are fused by inverse covariance. Every third frame is a keyframe for the sliding-window BA, whose refined landmarks re-anchor tracking. Orange: the two new modules.

Rigid-rig pose

One unknown pose per frame; the right camera is the left one shifted by the baseline \(\mathbf b\). Each landmark gives three residual rows:

$$\mathbf r_j=\begin{bmatrix}\pi(\mathbf T\mathbf P_j)-\mathbf u^L_j\\ \pi_u(\mathbf T\mathbf P_j-\mathbf b)-u^R_j\end{bmatrix}$$

\(v_R\) is left out: in a rectified rig it carries no depth, only rectification error. Residuals are whitened by \(\mathbf J\Sigma_j\mathbf J^\top+\sigma^2\mathbf I\), so far points weigh less without a cut-off. Jacobians are checked against finite differences.

Landmark fusion

Re-triangulating every frame copies each pose error into the next frame's points: a −0.0073°/frame yaw bias, −33° over KITTI 00. Instead each track keeps one landmark, fused in information form:

$$\begin{gathered}\Sigma\leftarrow(\Sigma^{-1}+\Sigma'^{-1})^{-1}\\ \mathbf P\leftarrow\Sigma\,(\Sigma^{-1}\mathbf P+\Sigma'^{-1}\mathbf P')\end{gathered}$$

The largest single gain in the project: KITTI 00 ATE 23.7 m → 10.4 m.

Window BA and loops

A 5-keyframe sliding window jointly refines poses and landmarks with the same rig residual and a Schur-complement LM (oldest keyframe fixed, trust region 0.5 m / 2°). The output stays causal.

ATE −39 % (NumPy) or −46 % (GTSAM). Loop closure with DINOv2 or thumbnail place recognition and a GTSAM pose graph brings KITTI 00 to 1.8 m.

03 What is new

Both modules are fully implemented, tested and evaluated. On a wide-baseline rig neither beats windowed BA alone, and the figures show exactly why: an honest, explained result.

New

Gated monocular depth priors

RoMeO gates monocular depth priors in a monocular VO, where they supply scale. In stereo the baseline owns the scale, so we ask a different question: where can a network still add depth a stereo rig lacks? Depth Anything V2 (218 MiB VRAM, 28 ms) feeds BA depth factors through five gates:

  1. Scale alignment to precise stereo (σZ/Z < 3 %) per keyframe
  2. Consistency within 3σ, tolerance taken from stereo
  3. Weak stereo only (σZ/Z > 5 %)
  4. One prior per landmark per window: network errors are correlated
  5. Trust region: reject updates moving the newest keyframe > 0.5 m / 2°
Depth-prior gate on KITTI 00 frame 300: grey precise stereo, green accepted priors; network depth vs stereo per landmark
Grey: precise stereo, no prior needed. Green: weak-stereo landmarks whose prior passed. Right: aligned network depth agrees with stereo up to ~40 m, then saturates.

Finding. Gating is essential (ungated 15.9 m → gated 7.5 m ATE), but BA alone is better (6.3 m): the priors that pass are the far points where the network saturates.

New

Dynamic and occluded points

Every fused landmark carries a covariance, so each new stereo point can be tested against it before fusion. A point on a moving object, or a track that slid onto another surface at an occlusion boundary, fails:

$$d_j^2=\Delta_j^\top(\Sigma_j+\Sigma'_j)^{-1}\Delta_j<\chi^2_{3,0.999}=16.27$$

Class-agnostic, no network, one 3×3 inverse per track; the tolerance adapts to depth. A SegFormer-B0 mask (people indoors; people and vehicles outdoors) keeps features off movers.

KITTI 07 frames with the semantic mask and the geometric gate
KITTI 07. Magenta: SegFormer mask. Green: kept; red ×: dropped by the mask; yellow ○: dropped by the gate. The mask also covers parked cars and hedges.

Finding. Masking parked cars hurts (dense ORB 8.97 → 22.16 m); in the sparse pipeline the gate and mask change ATE by at most 0.43 m. The gate is the safer default.

04 Results

The back end does the work: KITTI 00 ablation

ATE after SE(3) alignment · KITTI devkit drift trel over 100–800 m segments. Anchoring landmarks is the largest single cut.

KITTI devkit drift per segment length for the ablation
Drift per segment length, translation (left) and rotation (right): window BA is lowest at every length from 200 m.
KITTI 00 trajectories of the final-phase runs
KITTI 00 (3.7 km), SE(3)-aligned: VO alone drifts on the left loop; BA plus loop closure stays on the ground truth.

Loop closure

Keyframes get a global descriptor, either a downsampled thumbnail or DINOv2 features. Revisit candidates are verified with the stereo front end and PnP, and accepted loops become relative-pose constraints in a GTSAM pose graph.

On KITTI 00, thumbnails find 32 loops (ATE 1.79 m) and DINOv2 37 (1.86 m). The hybrid SuperPoint + LightGlue front end with BA and DINOv2 loops reaches the lowest ATE overall, 1.73 m over 3.7 km.

Loop closure is off in every front-end comparison, so drift stays visible.

Five front ends, one fixed back end

Same resolution, keypoint budget, ratio test, every PnP and keyframe threshold, and no loop closure: only the matcher changes.

Front end (KITTI 00)trelATERPEPnP inliersms / frameEuRoC ATE
ORB1.73 %8.97 m4.9 cm2524913.7 cm
SIFT1.41 %10.36 m2.9 cm325834.9 cm
SuperPoint + LightGlue1.80 %16.54 m3.2 cm4932337.1 cm
ALIKED + LightGlue1.62 %13.14 m2.9 cm50220410.9 cm
MASt3R2.22 %24.63 m3.3 cm36724913.5 cm
Sparse + window BA (ours)1.18 %6.33 m3.5 cm5261375.1 cm

Learned front ends double the inliers and lower per-frame error, but not drift: with depth and pose estimation fixed, matching quality is not the bottleneck.

Robustness of the classical and hybrid learned front ends under darkness, blur, noise and fast motion
Where learned features pay off: in the dark, under blur and in fast motion the hybrid SuperPoint + LightGlue front end never loses track; the classical one fails on 2–5 % of frames.

05 On the wheelchair

Two RealSense colour cameras on a mast, about 0.4 m apart, not hardware-synchronised. The classical pipeline runs live at 23–25 fps as a ROS 2 node, above the 15 fps camera rate.

Wheelchair demo: four frames with people walking past and the paths of four variants against the lidar odometry
run_human_long_loop, a 28 m loop with a person in view in 37 % of frames. Left: people are masked (red) and never tracked; red × are tracks a person walked onto. Right: four variants and wheel odometry, aligned to DLIO lidar-inertial odometry.
run_human_long_loopATE vs lidar
classical0.46 m
classical + dynamic0.65 m
learned0.79 m
learned + dynamic0.58 m

Single runs on one bag: dynamic filtering helps the learned front end here, not the classical one.

Online self-calibration

The camera mount moves between sessions, leaving rectified rows 20–50 px apart, and then nothing tracks. The node re-estimates the stereo rotation from live SIFT matches (essential matrix, Sampson refinement), keeping MC-Calib's metric baseline: a 22 px misalignment drops to 0.25 px in 0.4 s.

06 Takeaways

  • The back end matters most. Landmark fusion, the rig LM and windowed BA take KITTI 00 drift from 2.65 % to 1.18 %; the rig LM beats OpenCV's refinement in every KITTI pairing.
  • Learned features buy robustness, not accuracy. More and better matches do not lower drift on clean images, but they keep tracking in the dark, under blur and in fast motion.
  • Depth priors need gates, and a wide-baseline rig barely needs priors. They should pay off with a short baseline or distant, low-texture scenes.
  • Test motion, not class. "Vehicle = moving" is false on KITTI; the geometric gate drops few, isolated tracks and never a parked car.

07 Reproduce

Everything runs with uv on Python 3.10. The 45 tests need no datasets or GPU.

git clone https://github.com/MR-project-1/MetricVision.git && cd MetricVision
uv sync --all-groups --extra learned          # learned extra: SuperPoint/LightGlue, SegFormer, Depth Anything
uv run pytest                                 # 45 tests, synthetic data

# KITTI 00, sparse pipeline with the 5-keyframe window BA
uv run metricvision run configs/kitti.yaml --dataset-root ~/datasets/kitti \
  --pipeline sparse --window 5 --run-name sparse_fused_lm_ba5

# the two new modules
uv run metricvision run configs/kitti.yaml --dataset-root ~/datasets/kitti \
  --pipeline sparse --window 5 --depth-prior --run-name sparse_ba5_prior
uv run metricvision run configs/kitti.yaml --dataset-root ~/datasets/kitti --sequence 07 \
  --pipeline sparse --window 5 --dynamic-gate --dynamic-mask --run-name sparse_ba5_gate_mask

# wheelchair bags: four variants per bag against the lidar
JOBS=1 scripts/run_bag_study.sh

08 Cite

@misc{metricvision2026,
  title        = {MetricVision: Rigid-Rig Stereo Visual Odometry with Gated Depth Priors
                  and Dynamic-Object Handling on a Wheelchair Robot},
  author       = {Roy, Soumo and Azif, Mohammed and Ghosh, Tashmoy},
  year         = {2026},
  howpublished = {\url{https://github.com/MR-project-1/MetricVision}}
}