CodeMapping: Real-Time Dense Mapping for Sparse SLAM using Compact Scene Representations

Hidenobu Matsuki, Raluca Scona, Jan Czarnowski, Andrew J. Davison

Abstract

Sparse visual Simultaneous Localization and Mapping (SLAM) systems are robust for tracking but produce incomplete maps unsuitable for many robotic tasks. We present CodeMapping, a framework that transforms sparse SLAM outputs into high-quality dense 3D maps in real-time. By employing a Conditional Variational Autoencoder (cVAE) to learn compact scene representations, CodeMapping effectively densifies sparse landmarks. The system utilizes a separate thread for dense reconstruction, maintaining the real-time performance of the core navigation system.

Introduction

In robotics, sparse SLAM systems like ORB-SLAM provide accurate camera tracking but generate "clouds of dots" that lack the geometric detail required for obstacle avoidance or path planning. Conversely, dense SLAM systems, which map every pixel, are often computationally prohibitive and fragile in low-texture environments. CodeMapping bridges this gap by "densifying" reliable sparse SLAM outputs into usable 3D surfaces without sacrificing real-time efficiency.

Methodology

CodeMapping employs a loosely coupled architecture where a dense mapping thread processes data from a standard sparse SLAM system (ORB-SLAM3).

Conditional Variational Autoencoder (cVAE)

The core of the system is a cVAE that takes a grayscale image, a sparse depth map, and a reprojection error map as inputs. The inclusion of the error map is a key innovation; it allows the network to identify and ignore noisy sparse points (outliers) during surface generation.

Compact Scene Representation and Optimization

The VAE represents scene geometry using a 32-dimensional "latent code." To ensure temporal consistency, the system performs "sliding-window" optimization across multiple frames using a factor graph approach. This manifold-based optimization is significantly more efficient than optimizing raw depth values.

The CodeMapping pipeline: from sparse SLAM points (top left) to dense frame-wise reconstruction (top right) and the final global map (bottom).

Experimental Evaluation

The system was trained on the ScanNet dataset (~0.4M indoor RGB-D images) and evaluated on the EuRoC MAV dataset to test generalization in challenging drone-based laboratory environments.

Key Results

  • Accuracy and Consistency: CodeMapping outperformed state-of-the-art depth completion methods on ScanNet. Multi-view optimization improved depth accuracy by approximately 10% and reduced reconstruction drift.
  • Real-Time Performance: Dense predictions are generated in 11ms, with multi-view optimization running at 1Hz, enabling continuous global map updates.
  • Surface Quality: Qualitative tests, including physics simulations of objects bouncing off reconstructed walls, confirmed that the surfaces are sufficiently smooth and accurate for interaction.
A high-quality dense 3D reconstruction of an indoor environment generated by CodeMapping.

Conclusion and Future Work

While CodeMapping shows strong performance, its reliance on learned priors makes it sensitive to domain shifts (e.g., moving from apartments to industrial labs). Future work will explore extending the framework to include semantic mapping, enabling robots to identify specific objects within the dense 3D environment.

Summary updated

BibTeX
@article{matsuki2021codemapping,
  author = {Hidenobu Matsuki and Raluca Scona and Jan Czarnowski and Andrew J. Davison},
  title = {{CodeMapping: Real-Time Dense Mapping for Sparse SLAM using Compact Scene Representations}},
  journal = {IEEE Robotics Autom. Lett.},
  year = {2021},
  doi = {10.1109/lra.2021.3097258},
}
Figure