From 18e47b01c1a4345b66b5785e80ece37026e973c4 Mon Sep 17 00:00:00 2001 From: Dakota Benjamin Date: Wed, 22 Feb 2017 12:41:24 -0500 Subject: [PATCH] Expose Tone Mapping parameter --- opendm/config.py | 8 ++++++++ scripts/mvstex.py | 7 +++++-- scripts/odm_app.py | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/opendm/config.py b/opendm/config.py index 93dfaf01..b277fb04 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -266,6 +266,14 @@ def config(): help=('Keep faces in the mesh that are not seen in any camera. ' 'Default: %(default)s')) + parser.add_argument('--texturing-tone-mapping', + metavar='', + choices=['none', 'gamma'], + default='gamma', + help='Turn on gamma tone mapping or none for no tone ' + 'mapping. Choices are \'gamma\' or \'none\'. ' + 'Default: %(default)s ') + parser.add_argument('--gcp', metavar='', default=None, diff --git a/scripts/mvstex.py b/scripts/mvstex.py index 7e4b3ee9..022b6f5d 100644 --- a/scripts/mvstex.py +++ b/scripts/mvstex.py @@ -16,6 +16,7 @@ class ODMMvsTexCell(ecto.Cell): params.declare("skip_loc_seam_leveling", 'Skip local seam leveling (Poisson editing).', False) params.declare("skip_hole_fill", 'Skip hole filling.', False) params.declare("keep_unseen_faces", 'Keep unseen faces.', False) + params.declare("tone_mapping", 'Type of tone mapping: [none, gamma]. Default: gamma', "gamma") def declare_io(self, params, inputs, outputs): inputs.declare("tree", "Struct with paths", []) @@ -68,7 +69,7 @@ class ODMMvsTexCell(ecto.Cell): skipHoleFilling = "--skip_hole_filling" if (self.params.keep_unseen_faces): keepUnseenFaces = "--keep_unseen_faces" - + # mvstex definitions kwargs = { 'bin': context.mvstex_path, @@ -82,7 +83,8 @@ class ODMMvsTexCell(ecto.Cell): 'skipGlobalSeamLeveling': skipGlobalSeamLeveling, 'skipLocalSeamLeveling': skipLocalSeamLeveling, 'skipHoleFilling': skipHoleFilling, - 'keepUnseenFaces': keepUnseenFaces + 'keepUnseenFaces': keepUnseenFaces, + 'toneMapping': self.params.tone_mapping } if not args.use_pmvs: @@ -99,6 +101,7 @@ class ODMMvsTexCell(ecto.Cell): # run texturing binary system.run('{bin} {nvm_file} {model} {out_dir} ' '-d {dataTerm} -o {outlierRemovalType} ' + '-t {toneMapping} ' '{skipGeometricVisibilityTest} ' '{skipGlobalSeamLeveling} ' '{skipLocalSeamLeveling} ' diff --git a/scripts/odm_app.py b/scripts/odm_app.py index 92e2b186..626c7f4a 100644 --- a/scripts/odm_app.py +++ b/scripts/odm_app.py @@ -66,7 +66,8 @@ class ODMApp(ecto.BlackBox): skip_glob_seam_leveling=p.args.texturing_skip_global_seam_leveling, skip_loc_seam_leveling=p.args.texturing_skip_local_seam_leveling, skip_hole_fill=p.args.texturing_skip_hole_filling, - keep_unseen_faces=p.args.texturing_keep_unseen_faces), + keep_unseen_faces=p.args.texturing_keep_unseen_faces, + tone_mapping=p.args.texturing_tone_mapping), 'georeferencing': ODMGeoreferencingCell(img_size=p.args.resize_to, gcp_file=p.args.gcp, use_exif=p.args.use_exif,