kopia lustrzana https://github.com/OpenDroneMap/ODM
Add altitude tag support in OpenSfM
rodzic
95e54637f6
commit
e415dc1693
|
@ -79,8 +79,8 @@ class ODM_Photo:
|
|||
[metadata[GPS + 'LongitudeRef'].value])
|
||||
elif key == GPS + 'Altitude':
|
||||
self.altitude = float(metadata[key].value)
|
||||
if int(metadata[GPS + 'AltitudeRef'].value) > 0:
|
||||
self.altitude *= -1
|
||||
if metadata[GPS + 'AltitudeRef'] and int(metadata[GPS + 'AltitudeRef'].value) > 0:
|
||||
self.altitude *= -1.
|
||||
except (pyexiv2.ExifValueError, ValueError) as e:
|
||||
pass
|
||||
except NotImplementedError as e:
|
||||
|
|
|
@ -69,10 +69,14 @@ class ODMLoadDatasetCell(ecto.Cell):
|
|||
if files:
|
||||
# create ODMPhoto list
|
||||
path_files = [io.join_paths(images_dir, f) for f in files]
|
||||
photos = Pool().map(
|
||||
partial(make_odm_photo, self.params.force_focal, self.params.force_ccd),
|
||||
path_files
|
||||
)
|
||||
# photos = Pool().map(
|
||||
# partial(make_odm_photo, self.params.force_focal, self.params.force_ccd),
|
||||
# path_files
|
||||
# )
|
||||
|
||||
photos = []
|
||||
for files in path_files:
|
||||
photos += [make_odm_photo(self.params.force_focal, self.params.force_ccd, files)]
|
||||
|
||||
log.ODM_INFO('Found %s usable images' % len(photos))
|
||||
else:
|
||||
|
|
|
@ -57,8 +57,11 @@ class ODMOpenSfMCell(ecto.Cell):
|
|||
if not io.file_exists(output_file) or rerun_cell:
|
||||
# create file list
|
||||
list_path = io.join_paths(tree.opensfm, 'image_list.txt')
|
||||
has_alt = True
|
||||
with open(list_path, 'w') as fout:
|
||||
for photo in photos:
|
||||
if not photo.altitude:
|
||||
has_alt = False
|
||||
fout.write('%s\n' % photo.path_file)
|
||||
|
||||
# create config file for OpenSfM
|
||||
|
@ -70,6 +73,10 @@ class ODMOpenSfMCell(ecto.Cell):
|
|||
"matching_gps_neighbors: %s" % self.params.matching_gps_neighbors
|
||||
]
|
||||
|
||||
if has_alt:
|
||||
config.append("use_altitude_tag: True")
|
||||
config.append("align_method: naive")
|
||||
|
||||
if args.matcher_distance > 0:
|
||||
config.append("matching_gps_distance: %s" % self.params.matching_gps_distance)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue