Welcome to the Visual Odometry Pipeline repository! This project implements a streamlined Visual Odometry (VO) system using straightforward Python libraries such as NumPy, OpenCV, Pandas, Matplotlib, and PyTorch, along with the SuperGlue model for advanced feature matching. The pipeline is designed to process visual data, estimate camera poses, and visualize trajectories effectively.
- Feature Tracking with SuperGlue: Utilizes the SuperGlue model for robust feature matching between consecutive frames.
- Real-time Trajectory Visualization: Displays estimated and ground truth trajectories in XY, XZ, and YZ planes.
- Progress Monitoring: Includes a terminal-based progress bar to track processing status.
- Interpolated Ground Truth Data: Automatically generates and uses an interpolated CSV file to align ground truth data with camera timestamps.
- Comparison Plots: Produces plots comparing estimated poses with ground truth data.
Ensure you have the following installed:
- Python 3.7 or higher
- Git
- CUDA (optional): For GPU acceleration with PyTorch (recommended for SuperGlue)
-
Clone the Repository
git clone https://github.com/ufukasia/VO-with-SuperGlue-on-EuRoC-MAV-dataset.git cd VO-with-SuperGlue-on-EuRoC-MAV-dataset
Note: Ensure PyTorch with CUDA support is installed for optimal performance.
This pipeline is compatible with datasets structured similarly to the EuRoC MAV dataset. Ensure your dataset follows the directory structure below:
-
Download the Dataset:
Obtain the dataset (e.g., EuRoC MAV) and place it in the
dataset/
directory following the structure above. -
Verify File Paths:
Ensure that the camera and ground truth CSV files are correctly placed in their respective directories.
-
Check Image Files:
Camera images should be named using their corresponding timestamps (e.g.,
1234567890.png
) and placed in thecam0/data/
directory. -
Update Dataset Path (If Necessary):
If your dataset is located elsewhere, update the
dataset_path
variable in thesuperglue_EurocMAV.py
script accordingly:dataset_path = Path("path/to/your/dataset/MH_01_easy/mav0/")
Run the Visual Odometry pipeline by executing the main script. The script preprocesses ground truth data, performs feature tracking, estimates poses, and visualizes trajectories.
python superglue_EurocMAV.py
-
Preprocess Ground Truth Data:
The script generates an interpolated CSV file (
imu_with_interpolated_groundtruth.csv
) to align ground truth data with camera timestamps. -
Feature Tracking and Pose Estimation:
Utilizes SuperGlue for feature matching and estimates camera poses based on matched features.
-
Trajectory Visualization:
Displays real-time trajectories and saves comparison plots.
-
Interpolated Ground Truth Data:
imu_with_interpolated_groundtruth.csv
in theimu0/
directory.
-
Real-time Trajectory Visualizations:
- Three OpenCV windows displaying trajectories in XY, XZ, and YZ planes.
- A window showing the current camera frame.
This project is licensed under the MIT License.
- SuperGlue: For providing an advanced feature matching framework.
- OpenCV: For image processing and computer vision functionalities.
- PyTorch: For deep learning model support.
- tqdm: For the progress bar implementation.
- EuRoC MAV Dataset: For providing the dataset used in this pipeline.
Developed by Your Name. Feel free to reach out for any questions or collaborations.