This repo contains the code for the project Beacon-based Scale Estimation for Monocular Structure from Motion in Robotics Systems
pip install -r requirements.txt
Tested on Ubuntu 20.04 LTS + Python 3.8
Install COLMAP (https://github.com/colmap/colmap) and hloc (https://github.com/cvg/Hierarchical-Localization) to start the mapping phase. Note that we already provide some maps.
Unzip dataset.zip inside data/icra_data/
There are two ways to run the pipeline:
Incrementally adjust the scale using the available data coming from the beacons:
python tests/test_incremental_pipeline.py --input_model reconstruction_outputs/<recostruction_sequence>/sfm/
Compute the scale correction oneshot:
python tests/test_oneshot_pipeline.py --input_model reconstruction_outputs/<recostruction_sequence>/sfm/
- generate a point clouds (blue)
- generate a sets of measurements for the point cloud (red)
- estimate the Similarity transformation that aligns the two point clouds (cyan)
- refine the obtained solution estimating a Rigid transformation between the points and the measurements corrected with the Similarity above (green)
python tests/test_scale_estimator_module.py
Segment the given images.
python tests/test_segmentation_module.py
given a set of images
- extract features
- compute matches
- run a reconstruction
python tests/test_sfm_module.py
Note:
- hloc required
- in order to run a custom reconstruction the file test_sfm_module.py should be properly cofigurated.
- visualize a reconstruction
python tests/test_sfm_visualization.py --input_model reconstruction_outputs/<recostruction_sequence>/sfm/
generate 3 point clouds:
- a torus
- a sphere
- a cuboid with different level of noise
python tests/test_simulator_generation.py
Note:
- in order to generate a torus, a sphere or a cuboid the file test_simulator_generation.py should be properly modified.
given a reconstruction
- perform Iterative Closest Point optimization using the ground-truth poses and estimated poses
python tests/test_trajectory_alignment.py --input_model reconstruction_outputs/<recostruction_sequence>/sfm/