cars 1.0.0a3__cp313-cp313-win_amd64.whl → 1.0.0a4__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cars might be problematic. Click here for more details.
- cars/__init__.py +3 -3
- cars/applications/__init__.py +0 -3
- cars/applications/application_template.py +20 -0
- cars/applications/auxiliary_filling/abstract_auxiliary_filling_app.py +12 -2
- cars/applications/auxiliary_filling/auxiliary_filling_algo.py +2 -2
- cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +80 -36
- cars/applications/dem_generation/dem_generation_algo.py +1 -1
- cars/applications/dem_generation/dem_generation_wrappers.py +23 -57
- cars/applications/dem_generation/dichotomic_generation_app.py +3 -3
- cars/applications/dem_generation/rasterization_app.py +100 -41
- cars/applications/dense_match_filling/__init__.py +1 -1
- cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +2 -15
- cars/applications/dense_match_filling/fill_disp_algo.py +32 -373
- cars/applications/dense_match_filling/fill_disp_wrappers.py +0 -343
- cars/applications/dense_match_filling/zero_padding_app.py +10 -5
- cars/applications/dense_matching/abstract_dense_matching_app.py +2 -1
- cars/applications/dense_matching/census_mccnn_sgm_app.py +38 -39
- cars/applications/dense_matching/cpp/dense_matching_cpp.cp313-win_amd64.dll.a +0 -0
- cars/applications/dense_matching/cpp/dense_matching_cpp.cp313-win_amd64.pyd +0 -0
- cars/applications/dense_matching/dense_matching_algo.py +48 -14
- cars/applications/dense_matching/dense_matching_wrappers.py +11 -3
- cars/applications/dense_matching/disparity_grid_algo.py +84 -62
- cars/applications/dense_matching/loaders/pandora_loader.py +91 -33
- cars/applications/dsm_filling/border_interpolation_app.py +1 -7
- cars/applications/dsm_filling/bulldozer_filling_app.py +2 -8
- cars/applications/dsm_filling/exogenous_filling_app.py +4 -9
- cars/applications/grid_generation/abstract_grid_generation_app.py +1 -1
- cars/applications/grid_generation/epipolar_grid_generation_app.py +4 -2
- cars/applications/grid_generation/grid_correction_app.py +4 -1
- cars/applications/grid_generation/grid_generation_algo.py +7 -2
- cars/applications/ground_truth_reprojection/abstract_ground_truth_reprojection_app.py +1 -1
- cars/applications/ground_truth_reprojection/direct_localization_app.py +2 -2
- cars/applications/ground_truth_reprojection/ground_truth_reprojection_algo.py +2 -1
- cars/applications/point_cloud_fusion/abstract_pc_fusion_app.py +0 -155
- cars/applications/point_cloud_fusion/mapping_to_terrain_tiles_app.py +0 -658
- cars/applications/point_cloud_fusion/pc_fusion_algo.py +0 -1339
- cars/applications/point_cloud_fusion/pc_fusion_wrappers.py +0 -869
- cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +2 -1
- cars/applications/point_cloud_outlier_removal/outlier_removal_algo.py +9 -8
- cars/applications/point_cloud_outlier_removal/small_components_app.py +96 -267
- cars/applications/point_cloud_outlier_removal/statistical_app.py +116 -275
- cars/applications/rasterization/abstract_pc_rasterization_app.py +1 -1
- cars/applications/rasterization/rasterization_algo.py +18 -6
- cars/applications/rasterization/rasterization_wrappers.py +2 -1
- cars/applications/rasterization/simple_gaussian_app.py +60 -113
- cars/applications/resampling/abstract_resampling_app.py +1 -1
- cars/applications/resampling/bicubic_resampling_app.py +3 -1
- cars/applications/resampling/resampling_algo.py +16 -4
- cars/applications/resampling/resampling_wrappers.py +3 -1
- cars/applications/sparse_matching/abstract_sparse_matching_app.py +1 -1
- cars/applications/sparse_matching/sift_app.py +3 -3
- cars/applications/sparse_matching/sparse_matching_algo.py +3 -2
- cars/applications/sparse_matching/sparse_matching_wrappers.py +1 -1
- cars/applications/triangulation/abstract_triangulation_app.py +1 -1
- cars/applications/triangulation/line_of_sight_intersection_app.py +13 -11
- cars/applications/triangulation/pc_transform.py +552 -0
- cars/applications/triangulation/triangulation_algo.py +6 -4
- cars/applications/triangulation/triangulation_wrappers.py +1 -0
- cars/bundleadjustment.py +6 -6
- cars/cars.py +11 -9
- cars/core/cars_logging.py +80 -49
- cars/core/constants.py +0 -1
- cars/core/datasets.py +5 -2
- cars/core/geometry/abstract_geometry.py +256 -25
- cars/core/geometry/shareloc_geometry.py +110 -82
- cars/core/inputs.py +57 -19
- cars/core/outputs.py +1 -1
- cars/core/preprocessing.py +17 -3
- cars/core/projection.py +9 -6
- cars/core/tiling.py +10 -3
- cars/data_structures/cars_dataset.py +5 -5
- cars/data_structures/corresponding_tiles_tools.py +0 -103
- cars/data_structures/format_transformation.py +4 -1
- cars/devibrate.py +6 -3
- cars/extractroi.py +20 -21
- cars/orchestrator/cluster/abstract_cluster.py +15 -5
- cars/orchestrator/cluster/abstract_dask_cluster.py +6 -2
- cars/orchestrator/cluster/dask_jobqueue_utils.py +1 -1
- cars/orchestrator/cluster/log_wrapper.py +148 -21
- cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +11 -3
- cars/orchestrator/cluster/mp_cluster/multiprocessing_profiler.py +2 -2
- cars/orchestrator/cluster/pbs_dask_cluster.py +1 -1
- cars/orchestrator/cluster/sequential_cluster.py +5 -4
- cars/orchestrator/cluster/slurm_dask_cluster.py +1 -1
- cars/orchestrator/orchestrator.py +14 -3
- cars/orchestrator/registry/id_generator.py +1 -0
- cars/orchestrator/registry/saver_registry.py +2 -2
- cars/pipelines/conf_resolution/conf_final_resolution.json +5 -3
- cars/pipelines/default/default_pipeline.py +462 -1073
- cars/pipelines/parameters/advanced_parameters.py +74 -64
- cars/pipelines/parameters/advanced_parameters_constants.py +2 -5
- cars/pipelines/parameters/application_parameters.py +71 -0
- cars/pipelines/parameters/depth_map_inputs.py +0 -314
- cars/pipelines/parameters/dsm_inputs.py +40 -4
- cars/pipelines/parameters/output_parameters.py +2 -2
- cars/pipelines/parameters/sensor_inputs.py +30 -75
- cars/pipelines/parameters/sensor_inputs_constants.py +0 -2
- cars/pipelines/parameters/sensor_loaders/__init__.py +4 -3
- cars/pipelines/parameters/sensor_loaders/basic_classif_loader.py +106 -0
- cars/pipelines/parameters/sensor_loaders/{basic_sensor_loader.py → basic_image_loader.py} +16 -22
- cars/pipelines/parameters/sensor_loaders/pivot_classif_loader.py +121 -0
- cars/pipelines/parameters/sensor_loaders/{pivot_sensor_loader.py → pivot_image_loader.py} +10 -21
- cars/pipelines/parameters/sensor_loaders/sensor_loader.py +4 -6
- cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +1 -3
- cars/pipelines/pipeline_template.py +1 -3
- cars/pipelines/unit/unit_pipeline.py +527 -1016
- cars/starter.py +4 -3
- cars-1.0.0a4.dist-info/DELVEWHEEL +2 -0
- {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/METADATA +135 -53
- {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/RECORD +115 -131
- cars.libs/libgcc_s_seh-1-b2494fcbd4d80cf2c98fdd5261f6d850.dll +0 -0
- cars.libs/libstdc++-6-e9b0d12ae0e9555bbae55e8dfd08c3f7.dll +0 -0
- cars.libs/libwinpthread-1-7882d1b093714ccdfaf4e0789a817792.dll +0 -0
- cars/applications/dense_match_filling/cpp/__init__.py +0 -0
- cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp313-win_amd64.dll.a +0 -0
- cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp313-win_amd64.pyd +0 -0
- cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.py +0 -72
- cars/applications/dense_match_filling/cpp/includes/dense_match_filling.hpp +0 -46
- cars/applications/dense_match_filling/cpp/meson.build +0 -9
- cars/applications/dense_match_filling/cpp/src/bindings.cpp +0 -11
- cars/applications/dense_match_filling/cpp/src/dense_match_filling.cpp +0 -142
- cars/applications/dense_match_filling/plane_app.py +0 -556
- cars/applications/hole_detection/__init__.py +0 -30
- cars/applications/hole_detection/abstract_hole_detection_app.py +0 -125
- cars/applications/hole_detection/cloud_to_bbox_app.py +0 -346
- cars/applications/hole_detection/hole_detection_algo.py +0 -144
- cars/applications/hole_detection/hole_detection_wrappers.py +0 -53
- cars/applications/point_cloud_denoising/__init__.py +0 -29
- cars/applications/point_cloud_denoising/abstract_pc_denoising_app.py +0 -273
- cars/applications/point_cloud_fusion/__init__.py +0 -30
- cars/applications/point_cloud_fusion/cloud_fusion_constants.py +0 -39
- cars/applications/sparse_matching/pandora_sparse_matching_app.py +0 -0
- cars/pipelines/parameters/depth_map_inputs_constants.py +0 -25
- cars-1.0.0a3.dist-info/DELVEWHEEL +0 -2
- cars.libs/libgcc_s_seh-1-ca70890bbc5723b6d0ea31e9c9cded2b.dll +0 -0
- cars.libs/libstdc++-6-00ee19f73d5122a1277c137b1c218401.dll +0 -0
- cars.libs/libwinpthread-1-f5042e8e3d21edce20c1bc99445f551b.dll +0 -0
- {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/WHEEL +0 -0
- {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/entry_points.txt +0 -0
|
@@ -23,6 +23,7 @@ this module contains the dichotomic dem generation application class.
|
|
|
23
23
|
"""
|
|
24
24
|
# Standard library
|
|
25
25
|
import logging
|
|
26
|
+
import math
|
|
26
27
|
import os
|
|
27
28
|
import shutil
|
|
28
29
|
|
|
@@ -94,9 +95,8 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
94
95
|
self.postprocessing_median_filter_size = self.used_config[
|
|
95
96
|
"postprocessing_median_filter_size"
|
|
96
97
|
]
|
|
97
|
-
self.
|
|
98
|
-
|
|
99
|
-
]
|
|
98
|
+
self.dem_median_downscale = self.used_config["dem_median_downscale"]
|
|
99
|
+
self.dem_min_max_downscale = self.used_config["dem_min_max_downscale"]
|
|
100
100
|
self.fillnodata_max_search_distance = self.used_config[
|
|
101
101
|
"fillnodata_max_search_distance"
|
|
102
102
|
]
|
|
@@ -105,6 +105,7 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
105
105
|
self.bulldozer_max_object_size = self.used_config[
|
|
106
106
|
"bulldozer_max_object_size"
|
|
107
107
|
]
|
|
108
|
+
self.disable_bulldozer = self.used_config["disable_bulldozer"]
|
|
108
109
|
self.compute_stats = self.used_config["compute_stats"]
|
|
109
110
|
self.coregistration = self.used_config["coregistration"]
|
|
110
111
|
self.coregistration_max_shift = self.used_config[
|
|
@@ -137,10 +138,10 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
137
138
|
# Overload conf
|
|
138
139
|
overloaded_conf["method"] = conf.get("method", "bulldozer_on_raster")
|
|
139
140
|
overloaded_conf["resolution"] = conf.get(
|
|
140
|
-
"resolution", float(self.scaling_coeff *
|
|
141
|
+
"resolution", float(self.scaling_coeff * 0.5)
|
|
141
142
|
)
|
|
142
143
|
overloaded_conf["margin"] = conf.get(
|
|
143
|
-
"margin", float(self.scaling_coeff * 500)
|
|
144
|
+
"margin", [0.1, float(math.sqrt(self.scaling_coeff) * 500)]
|
|
144
145
|
)
|
|
145
146
|
overloaded_conf["morphological_filters_size"] = conf.get(
|
|
146
147
|
"morphological_filters_size", 30
|
|
@@ -151,8 +152,11 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
151
152
|
overloaded_conf["postprocessing_median_filter_size"] = conf.get(
|
|
152
153
|
"postprocessing_median_filter_size", 7
|
|
153
154
|
)
|
|
154
|
-
overloaded_conf["
|
|
155
|
-
"
|
|
155
|
+
overloaded_conf["dem_median_downscale"] = conf.get(
|
|
156
|
+
"dem_median_downscale", 10
|
|
157
|
+
)
|
|
158
|
+
overloaded_conf["dem_min_max_downscale"] = conf.get(
|
|
159
|
+
"dem_min_max_downscale", 2
|
|
156
160
|
)
|
|
157
161
|
overloaded_conf["fillnodata_max_search_distance"] = conf.get(
|
|
158
162
|
"fillnodata_max_search_distance", 50
|
|
@@ -160,11 +164,14 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
160
164
|
overloaded_conf["min_dem"] = conf.get("min_dem", -500)
|
|
161
165
|
overloaded_conf["max_dem"] = conf.get("max_dem", 1000)
|
|
162
166
|
overloaded_conf["height_margin"] = conf.get(
|
|
163
|
-
"height_margin", float(self.scaling_coeff * 20)
|
|
167
|
+
"height_margin", float(math.sqrt(self.scaling_coeff) * 20)
|
|
164
168
|
)
|
|
165
169
|
overloaded_conf["bulldozer_max_object_size"] = conf.get(
|
|
166
170
|
"bulldozer_max_object_size", 8
|
|
167
171
|
)
|
|
172
|
+
overloaded_conf["disable_bulldozer"] = conf.get(
|
|
173
|
+
"disable_bulldozer", False
|
|
174
|
+
)
|
|
168
175
|
overloaded_conf["compute_stats"] = conf.get("compute_stats", True)
|
|
169
176
|
overloaded_conf["coregistration"] = conf.get("coregistration", True)
|
|
170
177
|
overloaded_conf["coregistration_max_shift"] = conf.get(
|
|
@@ -178,16 +185,18 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
178
185
|
"method": str,
|
|
179
186
|
"resolution": And(Or(float, int), lambda x: x > 0),
|
|
180
187
|
application_constants.SAVE_INTERMEDIATE_DATA: bool,
|
|
181
|
-
"margin":
|
|
188
|
+
"margin": [Or(float, int)],
|
|
182
189
|
"morphological_filters_size": And(int, lambda x: x > 0),
|
|
183
190
|
"preprocessing_median_filter_size": And(int, lambda x: x > 0),
|
|
184
191
|
"postprocessing_median_filter_size": And(int, lambda x: x > 0),
|
|
185
|
-
"
|
|
192
|
+
"dem_median_downscale": And(int, lambda x: x > 0),
|
|
193
|
+
"dem_min_max_downscale": And(int, lambda x: x > 0),
|
|
186
194
|
"fillnodata_max_search_distance": And(int, lambda x: x > 0),
|
|
187
195
|
"min_dem": And(Or(int, float), lambda x: x < 0),
|
|
188
196
|
"max_dem": And(Or(int, float), lambda x: x > 0),
|
|
189
197
|
"height_margin": Or(list, float, int),
|
|
190
198
|
"bulldozer_max_object_size": And(int, lambda x: x > 0),
|
|
199
|
+
"disable_bulldozer": bool,
|
|
191
200
|
"compute_stats": bool,
|
|
192
201
|
"coregistration": bool,
|
|
193
202
|
"coregistration_max_shift": And(Or(int, float), lambda x: x > 0),
|
|
@@ -201,7 +210,7 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
201
210
|
return overloaded_conf
|
|
202
211
|
|
|
203
212
|
@cars_profile(name="DEM Generation")
|
|
204
|
-
def run(
|
|
213
|
+
def run( # pylint: disable=too-many-positional-arguments # noqa: C901
|
|
205
214
|
self,
|
|
206
215
|
dsm_file_name,
|
|
207
216
|
output_dir,
|
|
@@ -398,14 +407,17 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
398
407
|
out_dem.write(dem_median, 1)
|
|
399
408
|
with rio.open(dem_max_path, "w", **profile) as out_dem:
|
|
400
409
|
out_dem.write(dem_max, 1)
|
|
410
|
+
dem_filled_path = os.path.join(output_dir, "dem_filled.tif")
|
|
411
|
+
with rio.open(dem_filled_path, "w", **profile) as out_dem:
|
|
412
|
+
out_dem.write(dem_data, 1)
|
|
401
413
|
|
|
402
414
|
if self.save_intermediate_data:
|
|
403
415
|
intermediate_dem_min_path = os.path.join(
|
|
404
|
-
output_dir, "
|
|
416
|
+
output_dir, "dem_min_before_downsampling.tif"
|
|
405
417
|
)
|
|
406
418
|
shutil.copy2(dem_min_path, intermediate_dem_min_path)
|
|
407
419
|
intermediate_dem_max_path = os.path.join(
|
|
408
|
-
output_dir, "
|
|
420
|
+
output_dir, "dem_max_before_downsampling.tif"
|
|
409
421
|
)
|
|
410
422
|
shutil.copy2(dem_max_path, intermediate_dem_max_path)
|
|
411
423
|
|
|
@@ -414,45 +426,79 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
414
426
|
)
|
|
415
427
|
shutil.copy2(dem_median_path_out, intermediate_dem_median_path)
|
|
416
428
|
|
|
417
|
-
# Downsample
|
|
429
|
+
# Downsample dems
|
|
418
430
|
downsample_dem(
|
|
419
431
|
dem_median_path_out,
|
|
420
|
-
scale=self.
|
|
432
|
+
scale=self.dem_median_downscale,
|
|
433
|
+
interpolator="median",
|
|
421
434
|
median_filter_size=self.postprocessing_median_filter_size,
|
|
422
435
|
default_alt=default_alt,
|
|
423
436
|
)
|
|
424
437
|
|
|
425
|
-
|
|
426
|
-
saved_transform = edit_transform(
|
|
427
|
-
dem_min_path, resolution=resolution_in_meters
|
|
428
|
-
)
|
|
429
|
-
logging.info("Launch Bulldozer on DEM min")
|
|
430
|
-
temp_output_path = launch_bulldozer(
|
|
438
|
+
downsample_dem(
|
|
431
439
|
dem_min_path,
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
440
|
+
scale=self.dem_min_max_downscale,
|
|
441
|
+
interpolator="min",
|
|
442
|
+
default_alt=default_alt,
|
|
435
443
|
)
|
|
436
|
-
if temp_output_path is not None:
|
|
437
|
-
shutil.copy2(temp_output_path, dem_min_path)
|
|
438
|
-
edit_transform(dem_min_path, transform=saved_transform)
|
|
439
444
|
|
|
440
|
-
|
|
441
|
-
saved_transform = edit_transform(
|
|
442
|
-
dem_max_path, resolution=resolution_in_meters
|
|
443
|
-
)
|
|
444
|
-
reverse_dem(dem_max_path)
|
|
445
|
-
logging.info("Launch Bulldozer on DEM max")
|
|
446
|
-
temp_output_path = launch_bulldozer(
|
|
445
|
+
downsample_dem(
|
|
447
446
|
dem_max_path,
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
447
|
+
scale=self.dem_min_max_downscale,
|
|
448
|
+
interpolator="max",
|
|
449
|
+
default_alt=default_alt,
|
|
451
450
|
)
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
451
|
+
|
|
452
|
+
downsample_dem(
|
|
453
|
+
dem_filled_path,
|
|
454
|
+
scale=self.dem_min_max_downscale,
|
|
455
|
+
interpolator="nearest",
|
|
456
|
+
default_alt=default_alt,
|
|
457
|
+
)
|
|
458
|
+
|
|
459
|
+
if self.save_intermediate_data:
|
|
460
|
+
intermediate_dem_min_path = os.path.join(
|
|
461
|
+
output_dir, "dem_min_before_bulldozer.tif"
|
|
462
|
+
)
|
|
463
|
+
shutil.copy2(dem_min_path, intermediate_dem_min_path)
|
|
464
|
+
intermediate_dem_max_path = os.path.join(
|
|
465
|
+
output_dir, "dem_max_before_bulldozer.tif"
|
|
466
|
+
)
|
|
467
|
+
shutil.copy2(dem_max_path, intermediate_dem_max_path)
|
|
468
|
+
|
|
469
|
+
if not self.disable_bulldozer:
|
|
470
|
+
dem_min_max_res = resolution_in_meters * self.dem_min_max_downscale
|
|
471
|
+
# Launch Bulldozer on dem min
|
|
472
|
+
saved_transform = edit_transform(
|
|
473
|
+
dem_min_path, resolution=dem_min_max_res
|
|
474
|
+
)
|
|
475
|
+
logging.info("Launch Bulldozer on DEM min")
|
|
476
|
+
temp_output_path = launch_bulldozer(
|
|
477
|
+
dem_min_path,
|
|
478
|
+
os.path.join(output_dir, "dem_min_bulldozer"),
|
|
479
|
+
cars_orchestrator,
|
|
480
|
+
self.bulldozer_max_object_size,
|
|
481
|
+
)
|
|
482
|
+
if temp_output_path is not None:
|
|
483
|
+
shutil.copy2(temp_output_path, dem_min_path)
|
|
484
|
+
edit_transform(dem_min_path, transform=saved_transform)
|
|
485
|
+
|
|
486
|
+
# Inverse dem max and launch bulldozer
|
|
487
|
+
saved_transform = edit_transform(
|
|
488
|
+
dem_max_path, resolution=dem_min_max_res
|
|
489
|
+
)
|
|
490
|
+
reverse_dem(dem_max_path)
|
|
491
|
+
logging.info("Launch Bulldozer on DEM max")
|
|
492
|
+
temp_output_path = launch_bulldozer(
|
|
493
|
+
dem_max_path,
|
|
494
|
+
os.path.join(output_dir, "dem_max_bulldozer"),
|
|
495
|
+
cars_orchestrator,
|
|
496
|
+
self.bulldozer_max_object_size,
|
|
497
|
+
)
|
|
498
|
+
if temp_output_path is not None:
|
|
499
|
+
shutil.copy2(temp_output_path, dem_max_path)
|
|
500
|
+
reverse_dem(dem_max_path)
|
|
501
|
+
edit_transform(dem_max_path, transform=saved_transform)
|
|
456
502
|
|
|
457
503
|
# Check DEM min and max
|
|
458
504
|
with rio.open(dem_min_path, "r") as in_dem:
|
|
@@ -462,11 +508,14 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
462
508
|
with rio.open(dem_max_path, "r") as in_dem:
|
|
463
509
|
dem_max = in_dem.read()
|
|
464
510
|
dem_max_metadata = in_dem.meta
|
|
511
|
+
with rio.open(dem_filled_path, "r") as in_dem:
|
|
512
|
+
dem_data = in_dem.read()
|
|
465
513
|
dem_data[dem_data == nodata] = np.nan
|
|
466
514
|
dem_min[dem_min == nodata] = np.nan
|
|
467
515
|
dem_max[dem_max == nodata] = np.nan
|
|
468
516
|
if self.compute_stats:
|
|
469
517
|
diff = dem_data - dem_min
|
|
518
|
+
diff = diff[dem_data != 0]
|
|
470
519
|
logging.info(
|
|
471
520
|
"Statistics of difference between subsampled "
|
|
472
521
|
"DSM and DEM min (in meters)"
|
|
@@ -474,6 +523,7 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
474
523
|
compute_stats(diff)
|
|
475
524
|
|
|
476
525
|
diff = dem_max - dem_data
|
|
526
|
+
diff = diff[dem_data != 0]
|
|
477
527
|
logging.info(
|
|
478
528
|
"Statistics of difference between DEM max "
|
|
479
529
|
"and subsampled DSM (in meters)"
|
|
@@ -481,6 +531,7 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
481
531
|
compute_stats(diff)
|
|
482
532
|
|
|
483
533
|
diff = dem_max - dem_min
|
|
534
|
+
diff = diff[dem_data != 0]
|
|
484
535
|
logging.info(
|
|
485
536
|
"Statistics of difference between DEM max "
|
|
486
537
|
"and DEM min (in meters)"
|
|
@@ -500,6 +551,14 @@ class Rasterization(DemGeneration, short_name="bulldozer_on_raster"):
|
|
|
500
551
|
dem_max,
|
|
501
552
|
)
|
|
502
553
|
|
|
554
|
+
# Rectify pixels where DEM min > DEM max - margin, to ensure that
|
|
555
|
+
# DEM min < DEM max even on filled pixels
|
|
556
|
+
dem_min = np.where(
|
|
557
|
+
dem_min > dem_max - self.min_height_margin,
|
|
558
|
+
dem_max - self.min_height_margin,
|
|
559
|
+
dem_min,
|
|
560
|
+
)
|
|
561
|
+
|
|
503
562
|
with rio.open(dem_min_path, "w", **dem_min_metadata) as out_dem:
|
|
504
563
|
out_dem.write(dem_min)
|
|
505
564
|
with rio.open(dem_max_path, "w", **dem_max_metadata) as out_dem:
|
|
@@ -123,23 +123,10 @@ class DenseMatchFilling(ApplicationTemplate, metaclass=ABCMeta):
|
|
|
123
123
|
**kwargs,
|
|
124
124
|
):
|
|
125
125
|
"""
|
|
126
|
-
Run
|
|
126
|
+
Run filling application.
|
|
127
127
|
|
|
128
128
|
:param epipolar_disparity_map: left disparity
|
|
129
129
|
:type epipolar_disparity_map: CarsDataset
|
|
130
|
-
:param holes_bbox_left: left holes
|
|
131
|
-
:type holes_bbox_left: CarsDataset
|
|
132
|
-
:param holes_bbox_right: right holes
|
|
133
|
-
:type holes_bbox_right: CarsDataset
|
|
134
|
-
:param disp_min: minimum disparity
|
|
135
|
-
:type disp_min: int
|
|
136
|
-
:param disp_max: maximum disparity
|
|
137
|
-
:type disp_max: int
|
|
138
|
-
:param orchestrator: orchestrator used
|
|
139
|
-
:param pair_folder: folder used for current pair
|
|
140
|
-
:type pair_folder: str
|
|
141
|
-
:param pair_key: pair id
|
|
142
|
-
:type pair_key: str
|
|
143
130
|
|
|
144
131
|
:return: filled disparity map: \
|
|
145
132
|
The CarsDataset contains:
|
|
@@ -156,7 +143,7 @@ class DenseMatchFilling(ApplicationTemplate, metaclass=ABCMeta):
|
|
|
156
143
|
|
|
157
144
|
"""
|
|
158
145
|
|
|
159
|
-
def __register_dataset__(
|
|
146
|
+
def __register_dataset__( # pylint: disable=too-many-positional-arguments
|
|
160
147
|
self,
|
|
161
148
|
epipolar_disparity_map,
|
|
162
149
|
save_intermediate_data,
|