A modular monocular Visual Simultaneous Localization and Mapping (SLAM) system built from scratch in C++17. Implements the complete SLAM pipeline — feature detection, tracking, map initialization, 6-DOF pose estimation, and real-time 3D visualization — using only OpenCV as an external dependency.
The system is composed of six tightly integrated modules:
| Module | Responsibility |
|---|---|
FeatureTracker |
ORB feature detection and Lucas-Kanade optical flow tracking |
MapInitializer |
Two-view geometry initialization via Essential/Homography decomposition |
PoseEstimator |
Frame-to-frame 6-DOF pose recovery using PnP with RANSAC |
MapManager |
3D point cloud management, triangulation, and landmark lifecycle |
Visualizer |
2D feature overlay and tracking visualization |
PerspectiveVisualizer |
Real-time 3D point cloud and camera trajectory rendering |
- CMake ≥ 3.5
- C++17 compatible compiler (GCC ≥ 7, Clang ≥ 5, MSVC ≥ 19.14)
- OpenCV ≥ 4.0
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)./visual_perception [path/to/video.mp4]If no video path is provided, the system defaults to the included synthetic room sequence.
- Feature Detection: ORB (Oriented FAST and Rotated BRIEF) for robust, rotation-invariant keypoint extraction
- Tracking: Lucas-Kanade optical flow for efficient inter-frame correspondence matching
- Initialization: Dual-model approach (Essential + Homography) with automatic model selection based on scene geometry
- Pose Estimation: Perspective-n-Point (PnP) with iterative RANSAC for outlier-robust pose recovery
- Map Management: Dynamic landmark insertion/removal, outlier rejection, and covisibility graph tracking
- Performance: Compiler-level optimizations (
-O3,-march=native,-ffast-math) for real-time processing
The tests/ directory contains comprehensive test executables:
| Test | Description |
|---|---|
test_tracker |
Feature tracker unit validation |
test_initializer |
Map initialization correctness |
test_pose |
Pose estimation accuracy |
test_pnp_ground_truth |
PnP against known ground truth |
test_slam_adaptive |
Full pipeline integration test |
generate_synthetic_* |
Synthetic scene generators for reproducible testing |
A comprehensive technical report is available at docs/Monocular_SLAM_Report_Reitinger.pdf.
MIT License
