From 400899d5f9a8b93eb4ad5cc18db71e28f6a27a8c Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 16 May 2018 14:41:36 -0500 Subject: [PATCH] Exposed some opensfm parameters --- opendm/config.py | 34 ++++++++++++++++++++++++++++++++++ scripts/run_opensfm.py | 7 ++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/opendm/config.py b/opendm/config.py index 730546c0..19c320a8 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -147,6 +147,40 @@ def config(): help=('The maximum number of processes to use in dense ' 'reconstruction. Default: %(default)s')) + parser.add_argument('--opensfm-depthmap-resolution', + metavar='', + type=float, + default=640, + help=('Resolution of the depthmaps. Higher values take longer to compute ' + 'but produce denser point clouds. ' + 'Default: %(default)s')) + + parser.add_argument('--opensfm-depthmap-min-consistent-views', + metavar='', + type=int, + default=3, + help=('Minimum number of views that should reconstruct a point for it to be valid. Use lower values ' + 'if your images have few overlap. Lower values result in denser point clouds ' + 'but with more noise. ' + 'Default: %(default)s')) + + parser.add_argument('--opensfm-depthmap-method', + metavar='', + default='PATCH_MAP', + choices=['PATCH_MAP', 'BRUTE_FORCE', 'PATCH_MATCH_SAMPLE'], + help=('Raw depthmap computation algorithm. ' + 'PATCH_MAP and PATCH_MATCH_SAMPLE are faster, but might miss some valid points. ' + 'BRUTE_FORCE takes longer but produces denser reconstructions. ' + 'Default: %(default)s')) + + parser.add_argument('--opensfm-depthmap-min-patch-sd', + metavar='', + type=float, + default=1, + help=('When using PATCH_MAP or PATCH_MATCH_SAMPLE, controls the standard deviation threshold to include patches. ' + 'Patches with lower standard deviation are ignored. ' + 'Default: %(default)s')) + parser.add_argument('--use-hybrid-bundle-adjustment', action='store_true', default=False, diff --git a/scripts/run_opensfm.py b/scripts/run_opensfm.py index b28bca5c..af31d572 100644 --- a/scripts/run_opensfm.py +++ b/scripts/run_opensfm.py @@ -76,9 +76,10 @@ class ODMOpenSfMCell(ecto.Cell): "feature_min_frames: %s" % self.params.feature_min_frames, "processes: %s" % self.params.processes, "matching_gps_neighbors: %s" % self.params.matching_gps_neighbors, - # "depthmap_resolution: 2560", - # "depthmap_min_patch_sd: 4.0", - # "depthmap_min_consistent_views: 3", + "depthmap_method: %s" % args.opensfm_depthmap_method, + "depthmap_resolution: %s" % args.opensfm_depthmap_resolution, + "depthmap_min_patch_sd: %s" % args.opensfm_depthmap_min_patch_sd, + "depthmap_min_consistent_views: %s" % args.opensfm_depthmap_min_consistent_views, "optimize_camera_parameters: %s" % ('no' if self.params.fixed_camera_params else 'yes') ]