fix: osfm elevation check

pull/1482/head
Shuo Zhong 2022-06-22 14:14:36 -04:00
rodzic 8f5915cb79
commit be50747ff2
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -148,17 +148,25 @@ class OSFMContext:
photos = reconstruction.photos photos = reconstruction.photos
# create file list # create file list
num_zero_alt = 0
has_alt = True has_alt = True
has_gps = False has_gps = False
with open(list_path, 'w') as fout: with open(list_path, 'w') as fout:
for photo in photos: for photo in photos:
if photo.altitude is None: if photo.altitude is None:
has_alt = False has_alt = False
elif photo.altitude == 0:
num_zero_alt += 1
if photo.latitude is not None and photo.longitude is not None: if photo.latitude is not None and photo.longitude is not None:
has_gps = True has_gps = True
fout.write('%s\n' % os.path.join(images_path, photo.filename)) fout.write('%s\n' % os.path.join(images_path, photo.filename))
# check 0 altitude images percentage when has_alt is True
if has_alt and num_zero_alt / len(photos) > 0.05:
log.ODM_WARNING("More than 5% of images have zero altitude, this might be an indicator that the images have no altitude information")
has_alt = False
# check for image_groups.txt (split-merge) # check for image_groups.txt (split-merge)
image_groups_file = os.path.join(args.project_path, "image_groups.txt") image_groups_file = os.path.join(args.project_path, "image_groups.txt")
if 'split_image_groups_is_set' in args: if 'split_image_groups_is_set' in args: