This is a C++ implementation of our ECCV 2020 paper - "Stochastic Bundle Adjustment for Efficient and Scalable 3D Reconstruction" by Lei Zhou, Zixin Luo, Mingmin Zhen, Tianwei Shen, Shiwei Li, Zhuofei Huang, Tian Fang, Long Quan.
Benchmark on 1DSfM dataset
Benchmark on KITTI dataset
- Eigen3
- OpenMP
This repository currently comprises two versions of codes 0.0.0
and 1.0.0
which go into the master
and 1.0.0
branches, respectively.
The 0.0.0
codes are based on the plain workflow of an Levenberg-Marquardt solver, while the 1.0.0
codes are based on the implementation suggested by [1] Bundle Adjustment Rules and are supposed to be more computation and memory efficient. You can try different implementations by checking out different branches.
cd STBA
mkdir build && cd build
cmake ..
make
- Download the sparse reconstruction results of the COLMAP dataset (e.g., Gerrard Hall).
- Unzip the compressed file and three files can be found in the
sparse
folder:cameras.txt
,images.txt
andpoints3D.txt
. cd STBA/build
./STBA <path_to_cameras.txt> <path_to_imagess.txt> <path_to_points3D.txt> <output_folder>
- Run
./STBA --help
to see more options.--iteration
: Set the maximum number of iterations.--cluster
: A STBA option which sets the maximum cluster size for stochastic graph clustering.--inner_step
: A STBA option which sets the number of inner iterative steps.--thread_num
: Set thread number for OpenMP parallel computing.--radius
: Set the initial radius of trust region for the trust region solvers.--loss
: Set the type of robust loss function. Currently,Huber
andCauchy
loss functions are supported.--noise
: The magnitude/sigma of random Gaussian noise which will be added to track positions and camera centers for testing the bundle adjustment algorithms.--lm
: Use Levenberg-Marquardt solver.--dl
: Use DogLeg solver.
- Add parallel support to version
1.0.0
, particularly the functionStochasticBAProblem::EvaluateCamera()
.
This implementation was developed by Lei Zhou. Feel free to contact Lei for any enquiry.
[1] Engels, Chris, Henrik Stewénius, and David Nistér. "Bundle Adjustment Rules." Photogrammetric computer vision, 2(2006).