Fix --camera-lens

pull/1398/head
Piero Toffanin 2022-01-05 15:44:33 -05:00
rodzic 3e64c715fe
commit 37886f77c2
3 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -180,12 +180,12 @@ def config(argv=None, parser=None):
'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-lens',
metavar='<string>',
action=StoreValue,
default='auto',
choices=['auto', 'perspective', 'brown', 'fisheye', 'spherical'],
choices=['auto', 'perspective', 'brown', 'fisheye', 'spherical', 'equirectangular', 'dual'],
help=('Set a camera projection type. Manually setting a value '
'can help improve geometric undistortion. By default the application '
'tries to determine a lens type from the images metadata. Can be one of: %(choices)s. Default: '

Wyświetl plik

@ -617,6 +617,10 @@ class ODM_Photo:
def override_gps_dop(self, dop):
self.gps_xy_stddev = self.gps_z_stddev = dop
def override_camera_projection(self, camera_projection):
if camera_projection in projections:
self.camera_projection = camera_projection
def is_thermal(self):
#Added for support M2EA camera sensor
if(self.camera_make == "DJI"):

Wyświetl plik

@ -136,6 +136,13 @@ class ODMLoadDatasetStage(types.ODM_Stage):
for p in photos:
p.override_gps_dop(args.gps_accuracy)
# Override projection type
if args.camera_lens != "auto":
log.ODM_INFO("Setting camera lens to %s for all images" % args.camera_lens)
for p in photos:
p.override_camera_projection(args.camera_lens)
# Save image database for faster restart
save_images_database(photos, images_database_file)