From 4262c6484093fe23d6e47b6e372cadaf47551a2c Mon Sep 17 00:00:00 2001 From: Dakota Benjamin Date: Sun, 1 Jul 2018 18:49:53 -0400 Subject: [PATCH] Enable smvs for downstream modules --- opendm/types.py | 1 + scripts/mvstex.py | 7 +++++-- scripts/odm_georeferencing.py | 5 +++-- scripts/smvs.py | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/opendm/types.py b/opendm/types.py index 34a8170c..670e1e10 100644 --- a/opendm/types.py +++ b/opendm/types.py @@ -444,6 +444,7 @@ class ODM_Tree(object): self.mve_path = io.join_paths(self.opensfm, 'mve') self.mve_image_list = io.join_paths(self.mve_path, 'list.txt') self.mve_bundle = io.join_paths(self.mve_path, 'bundle/bundle.out') + self.mve_views = io.join_paths(self.smvs, 'views') # odm_meshing self.odm_mesh = io.join_paths(self.odm_meshing, 'odm_mesh.ply') diff --git a/scripts/mvstex.py b/scripts/mvstex.py index cb399522..11c55978 100644 --- a/scripts/mvstex.py +++ b/scripts/mvstex.py @@ -107,8 +107,11 @@ class ODMMvsTexCell(ecto.Cell): 'toneMapping': self.params.tone_mapping } - kwargs['nvm_file'] = io.join_paths(tree.opensfm, - "reconstruction.nvm") + if args.use_opensfm_dense: + kwargs['nvm_file'] = io.join_paths(tree.opensfm, + "reconstruction.nvm") + else: + kwargs['nvm_file'] = tree.smvs + "::undistorted" # Make sure tmp directory is empty mvs_tmp_dir = os.path.join(r['out_dir'], 'tmp') diff --git a/scripts/odm_georeferencing.py b/scripts/odm_georeferencing.py index 700e3db2..4e1bfd95 100644 --- a/scripts/odm_georeferencing.py +++ b/scripts/odm_georeferencing.py @@ -95,9 +95,10 @@ class ODMGeoreferencingCell(ecto.Cell): if args.fast_orthophoto: kwargs['pc'] = os.path.join(tree.opensfm, 'reconstruction.ply') - else: + elif args.use_opensfm_dense: kwargs['pc'] = tree.opensfm_model - + else: + kwargs['pc'] = tree.smvs_model # Check to see if the GCP file exists diff --git a/scripts/smvs.py b/scripts/smvs.py index bdb46bf2..e8751930 100644 --- a/scripts/smvs.py +++ b/scripts/smvs.py @@ -39,6 +39,8 @@ class ODMSmvsCell(ecto.Cell): log.ODM_ERROR('Not enough photos in photos array to start SMVS') return ecto.QUIT + system.mkdir_p(tree.smvs) + # check if we rerun cell or not rerun_cell = (args.rerun is not None and args.rerun == 'smvs') or \ @@ -57,7 +59,7 @@ class ODMSmvsCell(ecto.Cell): io.copy(tree.opensfm_bundle, tree.mve_bundle) # run mve makescene - if not io.dir_exists(tree.mve_path): + if not io.dir_exists(tree.mve_views): system.run('%s %s %s' % (context.makescene_path, tree.mve_path, tree.smvs)) # config