From febf592f11e16bf5dfd68d298ff460ffdb490549 Mon Sep 17 00:00:00 2001 From: Dakota Benjamin Date: Tue, 1 Aug 2017 15:00:13 -0400 Subject: [PATCH] Add new opensfm settings --- docker.settings.yaml | 1 + opendm/config.py | 5 +++++ scripts/odm_app.py | 3 ++- scripts/opensfm.py | 4 +++- settings.yaml | 1 + 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docker.settings.yaml b/docker.settings.yaml index 8109ea52..d01d3afb 100644 --- a/docker.settings.yaml +++ b/docker.settings.yaml @@ -15,6 +15,7 @@ project_path: '/' #DO NOT CHANGE THIS OR DOCKER WILL NOT WORK. It should be '/' #zip_results: False #verbose: False #time: False +#use_fixed_camera_params: False #opensfm_processes: 4 # by default this is set to $(nproc) #min_num_features: 4000 #matcher_threshold: 2.0 diff --git a/opendm/config.py b/opendm/config.py index ea0f91ac..cb68965c 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -151,6 +151,11 @@ def config(): 'matcher-neighbors and this to 0 to skip ' 'pre-matching. Default: %(default)s') + parser.add_argument('--use-fixed-camera-params', + action='store_true', + default=False, + help='Turn off camera parameter optimization during bundler') + parser.add_argument('--opensfm-processes', metavar='', default=1, diff --git a/scripts/odm_app.py b/scripts/odm_app.py index 060b49b7..deb2c3b5 100644 --- a/scripts/odm_app.py +++ b/scripts/odm_app.py @@ -46,7 +46,8 @@ class ODMApp(ecto.BlackBox): feature_min_frames=p.args.min_num_features, processes=p.args.opensfm_processes, matching_gps_neighbors=p.args.matcher_neighbors, - matching_gps_distance=p.args.matcher_distance), + matching_gps_distance=p.args.matcher_distance, + fixed_camera_params=p.args.use_fixed_camera_params), 'slam': ODMSlamCell(), 'cmvs': ODMCmvsCell(max_images=p.args.cmvs_maxImages), 'pmvs': ODMPmvsCell(level=p.args.pmvs_level, diff --git a/scripts/opensfm.py b/scripts/opensfm.py index 41fee755..0e195968 100644 --- a/scripts/opensfm.py +++ b/scripts/opensfm.py @@ -14,6 +14,7 @@ class ODMOpenSfMCell(ecto.Cell): params.declare("processes", "The application arguments.", context.num_cores) params.declare("matching_gps_neighbors", "The application arguments.", 8) params.declare("matching_gps_distance", "The application arguments.", 0) + params.declare("fixed_camera_params", "Optimize internal camera parameters", True) def declare_io(self, params, inputs, outputs): inputs.declare("tree", "Struct with paths", []) @@ -70,7 +71,8 @@ class ODMOpenSfMCell(ecto.Cell): "feature_process_size: %s" % self.params.feature_process_size, "feature_min_frames: %s" % self.params.feature_min_frames, "processes: %s" % self.params.processes, - "matching_gps_neighbors: %s" % self.params.matching_gps_neighbors + "matching_gps_neighbors: %s" % self.params.matching_gps_neighbors, + "optimize_camera_parameters: %s" % ('no' if self.params.fixed_camera_params else 'yes') ] if has_alt: diff --git a/settings.yaml b/settings.yaml index 7eac080f..eb582312 100644 --- a/settings.yaml +++ b/settings.yaml @@ -15,6 +15,7 @@ project_path: '' # Example: '/home/user/ODMProjects #zip_results: False #verbose: False #time: False +#use_fixed_camera_params: False #opensfm_processes: 4 # by default this is set to $(nproc) #min_num_features: 4000 #matcher_threshold: 2.0