romi / plant-3d-vision

Reconstruct a 3D digital twin of the plant from pictures (RGB images) and quantify its phyllotaxis.
https://docs.romi-project.eu/plant_imager/
GNU Lesser General Public License v3.0
5 stars 1 forks source link

A better colmap runner #62

Closed jlegrand62 closed 4 years ago

jlegrand62 commented 4 years ago

Can be initialized manually & not only used with the 'run' method. TODO: close log file handler & clean temporary workdir?

close #61

jlegrand62 commented 4 years ago

ColmapRunner can be used as follow:

from romiscan.colmap import ColmapRunner
from romidata import FSDB
db = FSDB("/data/ROMI/DB")
db.connect()
dataset = db.get_scan("2018-12-17_17-05-35")
fs = dataset.get_fileset('images')
cli_args = {"feature_extractor": {"--ImageReader.single_camera": "1", "--SiftExtraction.use_gpu": "1"}, "exhaustive_matcher": {"--SiftMatching.use_gpu": "1"}, "model_aligner": {"--robust_alignment_max_error": "10"}}

bbox = fs.get_metadata("bounding_box")
if bbox is None: bbox = fs.scan.get_metadata('workspace')
if bbox is None: bbox = fs.scan.get_metadata('scanner')['workspace']

colmap = ColmapRunner(fs, "exhaustive", False, cli_args, True, "", bbox)
colmap.colmap_feature_extractor()
colmap.colmap_matcher()
colmap.colmap_mapper()
colmap.colmap_model_aligner()
# To run them all at once and get variables:
points, images, cameras, sparse_pcd, dense_pcd, bounding_box = colmap.run()
jlegrand62 commented 4 years ago

Aucun changement pour l'utilisation par luigi. Par contre ColmapRunner est désormais appelable manuellement depuis Python.