Merge pull request #1880 from pierotofy/gpszoff

Add gps-z-offset
pull/1829/head
Piero Toffanin 2025-07-06 23:35:16 -04:00 zatwierdzone przez GitHub
commit 8b7d965371
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
3 zmienionych plików z 25 dodań i 1 usunięć

Wyświetl plik

@ -41,6 +41,7 @@ rerun_stages = {
'geo': 'dataset',
'gltf': 'mvs_texturing',
'gps_accuracy': 'dataset',
'gps_z_offset': 'dataset',
'help': None,
'ignore_gsd': 'opensfm',
'matcher_neighbors': 'opensfm',
@ -845,7 +846,17 @@ def config(argv=None, parser=None):
'with high precision GPS information (RTK), this value will be automatically '
'set accordingly. You can use this option to manually set it in case the reconstruction '
'fails. Lowering this option can sometimes help control bowling-effects over large areas. Default: %(default)s')
parser.add_argument('--gps-z-offset',
type=float,
action=StoreValue,
metavar='<float>',
default=0,
help='Set a GPS offset in meters for the vertical axis (Z) '
'by adding it to the altitude value of the GPS EXIF data. This does not change the value of any GCPs. '
'This can be useful for example when adjusting from ellipsoidal to orthometric height. '
'Default: %(default)s')
parser.add_argument('--optimize-disk-space',
action=StoreTrue,
nargs=0,

Wyświetl plik

@ -785,6 +785,12 @@ class ODM_Photo:
def override_gps_dop(self, dop):
self.gps_xy_stddev = self.gps_z_stddev = dop
def adjust_z_offset(self, z_offset):
if self.altitude is not None:
self.altitude += z_offset
else:
self.altitude = z_offset
def override_camera_projection(self, camera_projection):
if camera_projection in projections:

Wyświetl plik

@ -338,3 +338,10 @@ class ODMLoadDatasetStage(types.ODM_Stage):
if args.rolling_shutter and not reconstruction.is_georeferenced():
log.ODM_WARNING("Reconstruction is not georeferenced, disabling rolling shutter correction")
args.rolling_shutter = False
# GPS Z offset
if 'gps_z_offset_is_set' in args:
log.ODM_INFO("Adjusting GPS Z offset by %s for all images" % args.gps_z_offset)
for p in photos:
p.adjust_z_offset(args.gps_z_offset)