Update point cloud stats on rerun

pull/1354/head
Piero Toffanin 2021-10-08 23:24:30 -04:00
rodzic efab1b0ebd
commit fbdf5fcc21
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -28,8 +28,8 @@ def hms(seconds):
return '{}s'.format(round(s, 0))
def generate_point_cloud_stats(input_point_cloud, pc_info_file):
if not os.path.exists(pc_info_file):
def generate_point_cloud_stats(input_point_cloud, pc_info_file, rerun=False):
if not os.path.exists(pc_info_file) or rerun:
export_info_json(input_point_cloud, pc_info_file)
if os.path.exists(pc_info_file):
@ -89,7 +89,7 @@ class ODMReport(types.ODM_Stage):
# pc_info_file should have been generated by cropper
pc_info_file = os.path.join(tree.odm_georeferencing, "odm_georeferenced_model.info.json")
odm_stats['point_cloud_statistics'] = generate_point_cloud_stats(tree.odm_georeferencing_model_laz, pc_info_file)
odm_stats['point_cloud_statistics'] = generate_point_cloud_stats(tree.odm_georeferencing_model_laz, pc_info_file, self.rerun())
else:
ply_pc = os.path.join(tree.odm_filterpoints, "point_cloud.ply")
if os.path.exists(ply_pc):
@ -97,7 +97,7 @@ class ODMReport(types.ODM_Stage):
views_dimension = "views"
pc_info_file = os.path.join(tree.odm_filterpoints, "point_cloud.info.json")
odm_stats['point_cloud_statistics'] = generate_point_cloud_stats(ply_pc, pc_info_file)
odm_stats['point_cloud_statistics'] = generate_point_cloud_stats(ply_pc, pc_info_file, self.rerun())
else:
log.ODM_WARNING("No point cloud found")