colmap_sparse_recon
Sturcture-from-Motion using COLMAP
- input: unordered images
- outputs: the pose estimates for registered images and the reconstructed scene structure as a set of points
How to use
-
prepare data and build colmap
- Download the original data provided by DTU or the preprocessed data by MVSNet (Yao et al.)
- Build colmap (we use the version 3.6, the other versions should be OK)
- modify the
dataset_path
,colmap_exe_path
incolmap_sparse_recon.py
orcolmap_sparse_recon_posed.py
-
sparse reconstruction using colmap
-
For DTU (images with known camera poses)
python colmap_sparse_recon_posed.py
. You can download the triangulated sparse point cloud for DTU via GoogleDrive or BaiduNetDisk, Fetch Code:3puk
-
For Tanks and Temples training set
python colmap_sparse_recon.py
-
the results of the sparse reconstruction cloud be represented as
cameras.bin
,images.bin
andpoints3D.bin
-
-
convert sparse points to sparse depth map
- run
python colmap_sparse_to_depth.py
, the sparse depth map is saved as thepfm
file - the resolution of the sparse depth map could be adjusted by modifying the
new_w
andnew_h
- run
Visualization
-
Visualize the sparse points
- Use COLMAP GUI --> File --> Import model --> Select the sparse folder which contains cameras, images and points3D files (.bin/.txt)
-
Visualize the sparse depth map
python visualize_sparse.py xxx.pfm
RGB image | structure-from-motion |
sparse depth map | colmap depth map |
More about the sparse points generated by SfM
The research works which adopt the sparse points to boost the accuracy of multi-view geometric reconstruction:
- Sparse prior guided deep multi-view stereo
- Geo-Neus: Geometry-Consistent Neural Implicit Surfaces Learning for Multi-view Reconstruction
- Multi-View Guided Multi-View Stereo
Acknowledgement
The image set of SceauxCastle is provided by the author of OpenMVG.