Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monocular Visual SLAM

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.

3D Reconstruction and Camera Trajectory

Architecture

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

Build

Prerequisites

  • CMake ≥ 3.5
  • C++17 compatible compiler (GCC ≥ 7, Clang ≥ 5, MSVC ≥ 19.14)
  • OpenCV ≥ 4.0

Compilation

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

Usage

./visual_perception [path/to/video.mp4]

If no video path is provided, the system defaults to the included synthetic room sequence.

Technical Highlights

  • 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

Test Suite

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

Documentation

A comprehensive technical report is available at docs/Monocular_SLAM_Report_Reitinger.pdf.

License

MIT License

About

Monocular Visual SLAM system with ORB feature detection, triangulation, PnP pose estimation, and real-time 3D reconstruction (C++17, OpenCV)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages