~ / projects /

Visual Odometry for Autonomous Navigation

A robot that does not know where it is cannot navigate, track motion or avoid anything reliably. GPS fails indoors and in cities, inertial systems drift, and wheel odometry believes the wheels. Visual odometry estimates motion from the camera a robot is likely carrying anyway.

There are two ways to do it, and this project implemented both to compare them directly rather than argue from first principles.

Geometry

The classical route extracts and matches features between frames and solves for the motion that explains the correspondences. It works well and needs no training data, but errors compound: each estimate is relative to the last, so drift accumulates along the trajectory with nothing to correct it.

Depth came from stereo block matching, and from its semi-global variant, which enforces consistency along multiple paths through the image rather than optimizing each scanline alone.

Disparity map of a KITTI street scene from stereo block matching: speckled and noisy, with many missing regions.
Stereo block matching: sparse and noisy.
Disparity map of the same scene from semi-global block matching: smooth and dense, with the road surface clearly graded by depth.
Semi-global block matching: denser and better behaved in low-texture regions.

Learning

The alternative skips geometry altogether: a pretrained FlowNet CNN extracts motion features between consecutive frames, and an RNN carries state across the sequence to predict the trajectory directly. No camera calibration, no feature engineering and no explicit motion model; the network infers pose from pixels.

Architecture diagram: pairs of stacked video frames pass through a nine-layer convolutional network, then two LSTM layers, outputting a pose per time step.
Stacked consecutive frames go through a FlowNet-style CNN into a two-layer LSTM that outputs a pose at each step.

Results

Both were evaluated on KITTI, training on seven sequences and testing on five.

Three stacked plots of roll, pitch and yaw over a KITTI sequence, comparing the estimate in blue against ground truth in red; yaw tracks closely, roll and pitch less so.
Roll, pitch and yaw against ground truth on KITTI sequence 05.
3D plot of the estimated trajectory in blue against the ground-truth trajectory in red for KITTI sequence 05, with the start point marked.
The estimated trajectory against ground truth on the same sequence.

Finding. The two approaches performed comparably on KITTI, which is the interesting result given how differently they get there. The geometric method needs calibration and careful engineering, but generalizes anywhere. The learned model needs neither, but inherits whatever KITTI’s driving sequences taught it and has no principled reason to hold outside that distribution. Parity on this benchmark says the learned approach is viable, not that it is preferable.

  • Computer Vision
  • Deep Learning
  • SLAM