Implementation of the Visual Structure from Motion algorithm optimized for plant branching structures.
Pipeline: Build 3D root models from images captured by 3D root scanner, and compute 3D root trait by analyzing 3D root models and computing 3D root model structures.
This repo was to Reconstruct a 3D point cloud root model from images.
For example, a real root and a reconstruction, side by side:
The easiest way to use this software is with Docker or Singularity. A public Docker image definition is available: computationalplantscience/dirt3d-reconstruction
Pull an image or a repository from a registry
docker pull computationalplantscience/dirt3d-reconstruction
Mount the current working directory and open an interactive shell:
docker run -it -v $(pwd):/opt/dev -w /opt/dev computationalplantscience/dirt3d-reconstruction bash
To allow colmap
to use CUDA-enabled GPUs, use --gpus all
.
Open a shell in your current working directory:
singularity shell docker://computationalplantscience/dirt3d-reconstruction
To allow colmap
to use CUDA-enabled GPUs, use the --nv
flag.
To reconstruct a point cloud from an image set, use pipeline.py
as such:
python3 /opt/code/pipeline.py -i <input directory> -o <output directory> -g <how many GPUs to use>
Omit the -g <# of GPUs>
argument or set it to 0 to perform the reconstruction with CPUs only. Note that -g <# GPUs>
is short for --gpus <# GPUs>
.
A successful reconstruction will produce several files in the output directory:
sparse.ply
: sparse point cloud modeldense.ply
: dense point cloud modelmesh.ply
: dense mesh modeltimes.csv
: time costs per stepThere are several optional preprocessing steps, all of which accept values True
or False
(and default to False
):
--segmentation
: crops to the largest feature--blur_detection
: detects and omits blurry images--gamma_correction
: increases brightness of dark imagesBy default, PMVS2 is used for dense reconstruction on both CPU and GPU. Colmap can optionally be used with GPUs. It tends to produce significantly denser models but may run up to an order of magnitude more slowly.
To enable dense reconstruction with Colmap, use -d COLMAP
(short for --dense_strategy COLMAP
).
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 to 32
--window_step
: patch window step size, defaults to 1
--window_radius
: patch window radius, defaults to 5
--num_iterations
: number of patch match iterations, defaults to 5
--num_samples
: number of sampled views, defaults to 15
--geom_consistency
: whether to perform geometric dense reconstruction, defaults to False
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, VSFM, & PMVS2.
Anders Damsgaard with contributions by Caleb Adams and Connor P Doherty.
Changchang Wu ( wucc1130@gmail.com )
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},
}
Suxing Liu (suxingliu@gmail.com), Wesley Paul Bonelli(wbonelli@uga.edu)
Docker container was maintained and deployed to PlantIT by Wes Bonelli (wbonelli@uga.edu).
Singularity container overlay issues were solved by [Saravanaraj Ayyampalayam] (https://github.com/raj76) (mailto:raj76@uga.edu)
Special thanks to Chris Cotter building the Singularity container recipe for testing and debugging.
GNU Public License