From ae9986a5e84e60444dcfce94fb70a329395b2110 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Thu, 15 Aug 2019 10:55:18 -0400 Subject: [PATCH] Support for --camera-model --- opendm/config.py | 10 ++++++++++ opendm/osfm.py | 3 +++ 2 files changed, 13 insertions(+) diff --git a/opendm/config.py b/opendm/config.py index 2677b5b9..de33cc20 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -149,6 +149,16 @@ def config(): 'Can be specified either as path to a cameras.json file or as a ' 'JSON string representing the contents of a ' 'cameras.json file. Default: %(default)s') + + parser.add_argument('--camera-model', + metavar='', + default='auto', + choices=['auto', 'perspective', 'brown', 'fisheye'], + help=('Set a camera projection type. Manually setting a value ' + 'can help improve geometric undistortion. By default the application ' + 'tries to determine a projection type from the images metadata. Can be ' + 'set to one of: [auto, perspective, brown, fisheye]. Default: ' + '%(default)s')) parser.add_argument('--max-concurrency', metavar='', diff --git a/opendm/osfm.py b/opendm/osfm.py index 35de7ae4..a41e733e 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -116,6 +116,9 @@ class OSFMContext: "bundle_outlier_filtering_type: AUTO", ] + if args.camera_model != 'auto': + config.append("camera_projection_type: %s" % args.camera_model.upper()) + if not has_gps: log.ODM_INFO("No GPS information, using BOW matching") config.append("matcher_type: WORDS")