Added a warning before split-merge to ensure GPS/GCP info is present.

pull/1521/head
Umang Kalra 2022-08-05 00:36:20 +05:30
rodzic 6fee4be2b6
commit 3200dd27cd
2 zmienionych plików z 19 dodań i 1 usunięć

Wyświetl plik

@ -93,6 +93,13 @@ class ODM_Reconstruction(object):
def has_gcp(self):
return self.is_georeferenced() and self.gcp is not None and self.gcp.exists()
def has_geotagged_photos(self):
for photo in self.photos:
if photo.latitude is None and photo.longitude is None:
return False
return True
def georeference_with_gcp(self, gcp_file, output_coords_file, output_gcp_file, output_model_txt_geo, rerun=False):
if not io.file_exists(output_coords_file) or not io.file_exists(output_gcp_file) or rerun:

Wyświetl plik

@ -27,9 +27,17 @@ class ODMSplitStage(types.ODM_Stage):
reconstruction = outputs['reconstruction']
photos = reconstruction.photos
gps_info_available = False
# check for availability of either image_groups.txt (split-merge) or geotagged photos
image_groups_file = os.path.join(args.project_path, "image_groups.txt")
if 'split_image_groups_is_set' in args:
image_groups_file = os.path.abspath(args.split_image_groups)
if io.file_exists(image_groups_file) or reconstruction.has_geotagged_photos():
gps_info_available = True
outputs['large'] = len(photos) > args.split
if outputs['large']:
if outputs['large'] and gps_info_available:
# If we have a cluster address, we'll use a distributed workflow
local_workflow = not bool(args.sm_cluster)
@ -172,6 +180,9 @@ class ODMSplitStage(types.ODM_Stage):
else:
log.ODM_WARNING('Found a split done file in: %s' % split_done_file)
else:
if not gps_info_available:
log.ODM_WARNING('Could not perform split-merge as GPS information in photos or image_groups.txt is missing.')
log.ODM_INFO("Normal dataset, will process all at once.")
self.progress = 0.0