Adjust decimation step for cropping, catch edge case where convex hull is obliterated

pull/1156/head
Piero Toffanin 2020-09-16 17:59:00 +00:00
rodzic 9b57a23e4d
commit 3f133309aa
2 zmienionych plików z 14 dodań i 3 usunięć

Wyświetl plik

@ -189,8 +189,14 @@ class Cropper:
BUFFER_SMOOTH_DISTANCE = 3
if buffer_distance > 0:
convexhull = convexhull.Buffer(-(buffer_distance + BUFFER_SMOOTH_DISTANCE))
convexhull = convexhull.Buffer(BUFFER_SMOOTH_DISTANCE)
# For small areas, check that buffering doesn't obliterate
# our hull
tmp = convexhull.Buffer(-(buffer_distance + BUFFER_SMOOTH_DISTANCE))
tmp = tmp.Buffer(BUFFER_SMOOTH_DISTANCE)
if tmp.Area() > 0:
convexhull = tmp
else:
log.ODM_WARNING("Very small crop area detected, we will not smooth it.")
# Save to a new file
bounds_geojson_path = self.path('bounds.geojson')

Wyświetl plik

@ -120,7 +120,12 @@ class ODMGeoreferencingStage(types.ODM_Stage):
log.ODM_INFO("Calculating cropping area and generating bounds shapefile from point cloud")
cropper = Cropper(tree.odm_georeferencing, 'odm_georeferenced_model')
decimation_step = 40 if args.fast_orthophoto or args.use_opensfm_dense else 90
if args.fast_orthophoto:
decimation_step = 10
elif args.use_opensfm_dense:
decimation_step = 40
else:
decimation_step = 90
# More aggressive decimation for large datasets
if not args.fast_orthophoto: