Bug fixes, more memory efficient DEM smoothing

pull/1495/head
Piero Toffanin 2022-07-10 12:21:31 -04:00
rodzic cc7fb2efa5
commit 6e23de03a0
3 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -22,7 +22,7 @@ def compute_boundary_from_shots(reconstruction_json, buffer=0, reconstruction_of
for shot_image in reconstruction['shots']:
shot = reconstruction['shots'][shot_image]
if shot['gps_dop'] < 999999:
if shot.get('gps_dop', 999999) < 999999:
camera = reconstruction['cameras'][shot['camera']]
p = ogr.Geometry(ogr.wkbPoint)

Wyświetl plik

@ -333,7 +333,7 @@ def median_smoothing(geotiff_path, output_path, smoothing_iterations=1):
dtype = img.dtypes[0]
arr = img.read()[0]
nodata_locs = numpy.where(arr == nodata)
nodata_locs = arr == nodata
# Median filter (careful, changing the value 5 might require tweaking)
# the lines below. There's another numpy function that takes care of

Wyświetl plik

@ -28,9 +28,12 @@ class ODMFilterPoints(types.ODM_Stage):
if reconstruction.is_georeferenced():
if not 'boundary' in outputs:
avg_gsd = gsd.opensfm_reconstruction_average_gsd(tree.opensfm_reconstruction)
outputs['boundary'] = compute_boundary_from_shots(tree.opensfm_reconstruction, avg_gsd * 20, reconstruction.get_proj_offset()) # 20 is arbitrary
if outputs['boundary'] is None:
log.ODM_WARNING("Cannot compute boundary from camera shots")
if avg_gsd is not None:
outputs['boundary'] = compute_boundary_from_shots(tree.opensfm_reconstruction, avg_gsd * 20, reconstruction.get_proj_offset()) # 20 is arbitrary
if outputs['boundary'] is None:
log.ODM_WANING("Cannot compute boundary from camera shots")
else:
log.ODM_WARNING("Cannot compute boundary (GSD cannot be estimated)")
else:
log.ODM_WARNING("--auto-boundary set but so is --boundary, will use --boundary")
else: