From 069810cc4572453cf1b4b38b51b229fa43d6d6e3 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 26 Dec 2018 14:56:57 -0500 Subject: [PATCH] More aggressive decimation for large datasets during cropping Former-commit-id: 45a4afc5c93d45641f1033cbe37a30af27628481 --- scripts/odm_georeferencing.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/odm_georeferencing.py b/scripts/odm_georeferencing.py index 7e2ae4ac..ee3ac7a2 100644 --- a/scripts/odm_georeferencing.py +++ b/scripts/odm_georeferencing.py @@ -161,8 +161,17 @@ class ODMGeoreferencingCell(ecto.Cell): if args.crop > 0: 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 + + # More aggressive decimation for large datasets + if not args.fast_orthophoto: + num_photos = len(reconstruction.photos) + if num_photos > 1000: + decimation_step *= int(num_photos / 1000) + 1 + cropper.create_bounds_shapefile(tree.odm_georeferencing_model_laz, args.crop, - decimation_step=40 if args.fast_orthophoto or args.use_opensfm_dense else 90, + decimation_step=decimation_step, outlier_radius=20 if args.fast_orthophoto else 2) # Do not execute a second time, since