diff --git a/opendm/config.py b/opendm/config.py index f58d4263..9a9057fd 100644 --- a/opendm/config.py +++ b/opendm/config.py @@ -159,7 +159,7 @@ def config(): parser.add_argument('--cameras', default='', - metavar='', + metavar='', type=path_or_json_string, help='Use the camera parameters computed from ' 'another dataset instead of calculating them. ' diff --git a/opendm/osfm.py b/opendm/osfm.py index 7dfd6982..5cd8ef0c 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -89,8 +89,9 @@ class OSFMContext: # check for cameras if args.cameras: try: + camera_overrides = camera.get_opensfm_camera_models(args.cameras) with open(os.path.join(self.opensfm_project_path, "camera_models_overrides.json"), 'w') as f: - f.write(json.dumps(camera.get_opensfm_camera_models(args.cameras))) + f.write(json.dumps(camera_overrides)) log.ODM_DEBUG("Wrote camera_models_overrides.json to OpenSfM directory") except Exception as e: log.ODM_WARNING("Cannot set camera_models_overrides.json: %s" % str(e)) diff --git a/tests/assets/gcp_extras.txt b/tests/assets/gcp_extras.txt new file mode 100644 index 00000000..dcfe6f2a --- /dev/null +++ b/tests/assets/gcp_extras.txt @@ -0,0 +1,4 @@ +WGS84 UTM 16N +609924.8180680283 4950688.771811823 171.662982 1331 350 DJI_0002.JPG gcp1 +609924.8180680283 4950688.771811823 171.662982 2028 87 DJI_0003.JPG gcp1 +609924.8180680283 4950688.771811823 171.662982 2101 1181 DJI_0004.JPG gcp1