Pipeline: Build 3D root models from images captured by 3D root scanner.
This repo was to reconstruct a 3D point cloud root model from images captured by our 3D root scanner or portable scanner in the field.
For example, images are captured by our 3D root scanner with 10 cameras mouting on a rotating arm.
Our upgraded portable scanner can capture around 240 images in 7 mins:
and build 3D point cloud models based on only these 240 images.
The easiest way to use this software is with Docker or Singularity. A public Docker image definition is available: computationalplantscience/3d_colmap
Pull an image or a repository from a registry
docker pull computationalplantscience/3d_colmap
Mount the current working directory "/opt/dev" and open an interactive shell:
docker run -it -v $(pwd):/opt/dev -w /opt/dev computationalplantscience/3d_colmap bash
This docker container was compiled based on nvidia/cuda:12.2.2-devel-ubuntu22.04, and supports GPU running under HPC Singularity environment.
This docker was tested on GPU node in Puma HPC. It will automatically detect the CPU and GPU nodes, if GPU was detected, it will use CUDA to speed up.
We needs a CUDA_ARCH_BIN flag to be set in order to compile the binaries with the correct CUDA architecture.
If this flag is not set correctly, the final use of the binaries would fail.
For example, Volta GPU (v100), NVIDIA V100 has Compute Capability as 7.0
or one A100 MIG slice, NVIDIA A100 has Compute Capability as 8.0
The Docker recipe file was created as "Dockerfile", and DockerHub (computationalplantscience/3d_colmap) was setup linked to this repo directly and in automatic trigger compile mode.
The Colmap pipeline was in bash file "colmap_pipeline.sh"
Open a shell in your current working directory:
singularity shell docker://computationalplantscience/3d_colmap
To reconstruct a point cloud from an image set, use colmap_pipeline.sh
as such:
./colmap_pipeline.sh
A successful reconstruction will produce several files in the output directory:
sparse.ply
: sparse point cloud modeldense.ply
: dense point cloud model
There are several configurable values for colmap's patch matching step during dense reconstruction. Optimal values will vary by host machine.
--cache_size
: cache size (in GB) to use during patch matching, defaults to32
--window_step
: patch window step size, defaults to1
--window_radius
: patch window radius, defaults to5
--num_iterations
: number of patch match iterations, defaults to5
--num_samples
: number of sampled views, defaults to15
--geom_consistency
: whether to perform geometric dense reconstruction, defaults toTrue
Currently this software does not support model visualization. PLY files can be visualized with e.g. Meshlab or cloudcompare.
This software is built on top of COLMAP, Recommended dependencies: CUDA (at least version 7.X).
https://colmap.github.io Author: Johannes L. Schoenberger (jsch-at-demuc-dot-de) @inproceedings{schoenberger2016sfm, author={Sch"{o}nberger, Johannes Lutz and Frahm, Jan-Michael}, title={Structure-from-Motion Revisited}, booktitle={Conference on Computer Vision and Pattern Recognition (CVPR)}, year={2016}, }
@inproceedings{schoenberger2016mvs, author={Sch"{o}nberger, Johannes Lutz and Zheng, Enliang and Pollefeys, Marc and Frahm, Jan-Michael}, title={Pixelwise View Selection for Unstructured Multi-View Stereo}, booktitle={European Conference on Computer Vision (ECCV)}, year={2016}, }
@article{Liu2023, author = {Liu, Suxing and Bonelli, Wesley Paul and Pietrzyk, Peter and Bucksch, Alexander}, title = {Comparison of open-source three-dimensional reconstruction pipelines for maize-root phenotyping}, journal = {The Plant Phenome Journal}, volume = {6}, number = {1}, pages = {e20068}, doi = {https://doi.org/10.1002/ppj2.20068}, year = {2023}, }
Suxing Liu (suxingliu@gmail.com)
GNU Public License
This docker recipe was developed based on COLMAP official documents
and COLMAP setup
and UA HPC GPUs
and NVIDIA Developer Program, GPU Compute Capability
This repo was to replace the old one "Computational-Plant-Science/3D_model_reconstruction_demo" which has compatible issue after HPC Puma upgraded to new OS sysytem.