slambook
Example C++ code organized by chapter for a Chinese textbook on Visual SLAM, the technique robots and self-driving cars use to build a map and locate themselves within it simultaneously using camera images.
This repository contains the companion code for a Chinese textbook called "14 Lectures on Visual SLAM: From Theory to Practice," published in 2017. SLAM stands for Simultaneous Localization and Mapping, a technique used in robotics and computer vision where a device (such as a robot or a self-driving car) builds a map of its surroundings at the same time as it figures out its own position within that map. Visual SLAM specifically does this using camera images rather than laser sensors.
The code is organized by chapter, with folders named ch2 through ch13 plus a project folder for chapter 9. Each chapter pairs written theory in the book with runnable C++ examples. Topics covered include 3D geometry, camera models, image processing, non-linear optimization, and techniques for detecting and closing loops in a map. The final chapter covers building dense 3D reconstructions from camera data.
The author notes at the top of the README that a second edition of the book (slambook2) was released in 2019 with better compatibility for newer Linux systems, and that an English-language version (slambook-en) has also been completed. New readers are encouraged to switch to those newer repositories rather than this first edition.
The code is published under the MIT license, meaning anyone can use, modify, or build on it without asking permission. The README is brief and primarily serves as orientation for people who already have the book in hand and want to run the examples on their own computer. It does not explain SLAM concepts itself; that content lives in the book. The repository has no description field, but the book citation and chapter list give a clear sense of the scope.
Where it fits
- Follow a Visual SLAM textbook chapter by chapter by compiling and running the matching C++ examples on your own computer.
- Study how non-linear optimization is applied to camera pose estimation by reading and running the optimization chapter code.
- Use the dense 3D reconstruction examples as a starting point for a robotics or computer vision research project.