cars 1.0.0a3__cp312-cp312-win_amd64.whl → 1.0.0a4__cp312-cp312-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.cp312-win_amd64.dll.a +0 -0
- cars/applications/dense_matching/cpp/dense_matching_cpp.cp312-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.cp312-win_amd64.dll.a +0 -0
- cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp312-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
|
@@ -30,8 +30,7 @@ import rasterio as rio
|
|
|
30
30
|
from json_checker import And, Checker, OptionalKey, Or
|
|
31
31
|
|
|
32
32
|
from cars.pipelines.parameters import advanced_parameters_constants as adv_cst
|
|
33
|
-
from cars.pipelines.parameters import
|
|
34
|
-
from cars.pipelines.parameters import depth_map_inputs_constants as depth_cst
|
|
33
|
+
from cars.pipelines.parameters import dsm_inputs
|
|
35
34
|
from cars.pipelines.parameters import dsm_inputs_constants as dsm_cst
|
|
36
35
|
from cars.pipelines.parameters import sensor_inputs
|
|
37
36
|
from cars.pipelines.parameters import sensor_inputs_constants as sens_cst
|
|
@@ -39,7 +38,25 @@ from cars.pipelines.parameters.sensor_inputs import CARS_GEOID_PATH
|
|
|
39
38
|
from cars.pipelines.pipeline_constants import ADVANCED
|
|
40
39
|
|
|
41
40
|
|
|
42
|
-
def
|
|
41
|
+
def get_epipolar_resolutions(conf):
|
|
42
|
+
"""
|
|
43
|
+
Get the epipolar resolutions from the configuration
|
|
44
|
+
|
|
45
|
+
:param conf: configuration of advanced parameters
|
|
46
|
+
:type conf: dict
|
|
47
|
+
|
|
48
|
+
:return: list of epipolar resolutions
|
|
49
|
+
:rtype: list
|
|
50
|
+
"""
|
|
51
|
+
if adv_cst.EPIPOLAR_RESOLUTIONS in conf:
|
|
52
|
+
return conf[adv_cst.EPIPOLAR_RESOLUTIONS]
|
|
53
|
+
|
|
54
|
+
return [16, 4, 1]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def check_advanced_parameters(
|
|
58
|
+
inputs, conf, check_epipolar_a_priori=True, output_dem_dir=None
|
|
59
|
+
):
|
|
43
60
|
"""
|
|
44
61
|
Check the advanced parameters consistency
|
|
45
62
|
|
|
@@ -65,7 +82,8 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
65
82
|
)
|
|
66
83
|
|
|
67
84
|
overloaded_conf[adv_cst.KEEP_LOW_RES_DIR] = conf.get(
|
|
68
|
-
adv_cst.KEEP_LOW_RES_DIR,
|
|
85
|
+
adv_cst.KEEP_LOW_RES_DIR,
|
|
86
|
+
bool(overloaded_conf[adv_cst.SAVE_INTERMEDIATE_DATA]),
|
|
69
87
|
)
|
|
70
88
|
|
|
71
89
|
overloaded_conf[adv_cst.DEBUG_WITH_ROI] = conf.get(
|
|
@@ -78,11 +96,16 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
78
96
|
|
|
79
97
|
overloaded_conf[adv_cst.PHASING] = conf.get(adv_cst.PHASING, None)
|
|
80
98
|
|
|
81
|
-
overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS] =
|
|
82
|
-
|
|
99
|
+
overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS] = get_epipolar_resolutions(
|
|
100
|
+
conf
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
# use endogenous dm when generated
|
|
104
|
+
overloaded_conf[adv_cst.USE_ENDOGENOUS_DEM] = conf.get(
|
|
105
|
+
adv_cst.USE_ENDOGENOUS_DEM,
|
|
106
|
+
inputs[sens_cst.INITIAL_ELEVATION][sens_cst.DEM_PATH] is None,
|
|
83
107
|
)
|
|
84
108
|
|
|
85
|
-
overloaded_conf[adv_cst.MERGING] = conf.get(adv_cst.MERGING, False)
|
|
86
109
|
overloaded_conf[adv_cst.DSM_MERGING_TILE_SIZE] = conf.get(
|
|
87
110
|
adv_cst.DSM_MERGING_TILE_SIZE, 4000
|
|
88
111
|
)
|
|
@@ -124,35 +147,25 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
124
147
|
check_ground_truth_dsm_data(overloaded_conf[adv_cst.GROUND_TRUTH_DSM])
|
|
125
148
|
|
|
126
149
|
if check_epipolar_a_priori:
|
|
127
|
-
# Check conf use_epipolar_a_priori
|
|
128
|
-
overloaded_conf[adv_cst.USE_EPIPOLAR_A_PRIORI] = conf.get(
|
|
129
|
-
adv_cst.USE_EPIPOLAR_A_PRIORI, False
|
|
130
|
-
)
|
|
131
150
|
# Retrieve epipolar_a_priori if it is provided
|
|
132
151
|
overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI] = conf.get(
|
|
133
|
-
adv_cst.EPIPOLAR_A_PRIORI,
|
|
152
|
+
adv_cst.EPIPOLAR_A_PRIORI, None
|
|
134
153
|
)
|
|
135
154
|
# Retrieve terrain_a_priori if it is provided
|
|
136
155
|
overloaded_conf[adv_cst.TERRAIN_A_PRIORI] = conf.get(
|
|
137
|
-
adv_cst.TERRAIN_A_PRIORI,
|
|
156
|
+
adv_cst.TERRAIN_A_PRIORI, None
|
|
138
157
|
)
|
|
139
158
|
|
|
140
159
|
# Check geometry plugin
|
|
141
160
|
geom_plugin_without_dem_and_geoid = None
|
|
142
161
|
geom_plugin_with_dem_and_geoid = None
|
|
143
|
-
dem_generation_roi = None
|
|
144
|
-
|
|
145
|
-
# If use a priori, override initial elevation with dem_median
|
|
146
|
-
if adv_cst.USE_EPIPOLAR_A_PRIORI in overloaded_conf:
|
|
147
|
-
if overloaded_conf[adv_cst.USE_EPIPOLAR_A_PRIORI]:
|
|
148
|
-
if adv_cst.DEM_MEDIAN in overloaded_conf[adv_cst.TERRAIN_A_PRIORI]:
|
|
149
|
-
inputs[sens_cst.INITIAL_ELEVATION][sens_cst.DEM_PATH] = (
|
|
150
|
-
overloaded_conf[adv_cst.TERRAIN_A_PRIORI][
|
|
151
|
-
adv_cst.DEM_MEDIAN
|
|
152
|
-
]
|
|
153
|
-
)
|
|
154
162
|
|
|
155
163
|
scaling_coeff = None
|
|
164
|
+
# Get last resolution for scaling
|
|
165
|
+
if isinstance(overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS], list):
|
|
166
|
+
epipolar_resolution = overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS][-1]
|
|
167
|
+
else:
|
|
168
|
+
epipolar_resolution = overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS]
|
|
156
169
|
if inputs[sens_cst.SENSORS] is not None:
|
|
157
170
|
# Check geometry plugin and overwrite geomodel in conf inputs
|
|
158
171
|
(
|
|
@@ -160,12 +173,14 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
160
173
|
overloaded_conf[adv_cst.GEOMETRY_PLUGIN],
|
|
161
174
|
geom_plugin_without_dem_and_geoid,
|
|
162
175
|
geom_plugin_with_dem_and_geoid,
|
|
163
|
-
dem_generation_roi,
|
|
164
176
|
scaling_coeff,
|
|
165
177
|
) = sensor_inputs.check_geometry_plugin(
|
|
166
|
-
inputs,
|
|
178
|
+
inputs,
|
|
179
|
+
conf.get(adv_cst.GEOMETRY_PLUGIN, None),
|
|
180
|
+
epipolar_resolution,
|
|
181
|
+
output_dem_dir,
|
|
167
182
|
)
|
|
168
|
-
elif
|
|
183
|
+
elif dsm_cst.DSMS in inputs:
|
|
169
184
|
# assume the input comes from 0.5m sensor images
|
|
170
185
|
scaling_coeff = 1
|
|
171
186
|
# If there's an initial elevation with
|
|
@@ -173,7 +188,7 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
173
188
|
(
|
|
174
189
|
overloaded_conf[adv_cst.GEOMETRY_PLUGIN],
|
|
175
190
|
geom_plugin_with_dem_and_geoid,
|
|
176
|
-
) =
|
|
191
|
+
) = dsm_inputs.check_geometry_plugin(
|
|
177
192
|
inputs, conf.get(adv_cst.GEOMETRY_PLUGIN, None)
|
|
178
193
|
)
|
|
179
194
|
|
|
@@ -183,7 +198,6 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
183
198
|
# Validate inputs
|
|
184
199
|
schema = {
|
|
185
200
|
adv_cst.DEBUG_WITH_ROI: bool,
|
|
186
|
-
adv_cst.MERGING: bool,
|
|
187
201
|
adv_cst.SAVE_INTERMEDIATE_DATA: Or(dict, bool),
|
|
188
202
|
adv_cst.KEEP_LOW_RES_DIR: bool,
|
|
189
203
|
adv_cst.GROUND_TRUTH_DSM: Or(dict, str),
|
|
@@ -196,11 +210,11 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
196
210
|
adv_cst.EPIPOLAR_RESOLUTIONS: Or(int, list),
|
|
197
211
|
adv_cst.LAND_COVER_MAP: str,
|
|
198
212
|
adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING: str,
|
|
213
|
+
adv_cst.USE_ENDOGENOUS_DEM: bool,
|
|
199
214
|
}
|
|
200
215
|
if check_epipolar_a_priori:
|
|
201
|
-
schema[adv_cst.
|
|
202
|
-
schema[adv_cst.
|
|
203
|
-
schema[adv_cst.TERRAIN_A_PRIORI] = dict
|
|
216
|
+
schema[adv_cst.EPIPOLAR_A_PRIORI] = Or(None, dict)
|
|
217
|
+
schema[adv_cst.TERRAIN_A_PRIORI] = Or(None, dict)
|
|
204
218
|
|
|
205
219
|
checker_advanced_parameters = Checker(schema)
|
|
206
220
|
checker_advanced_parameters.validate(overloaded_conf)
|
|
@@ -209,6 +223,7 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
209
223
|
epipolar_schema = {
|
|
210
224
|
adv_cst.GRID_CORRECTION: Or(list, None),
|
|
211
225
|
adv_cst.DISPARITY_RANGE: list,
|
|
226
|
+
adv_cst.REFERENCE_DEM: Or(str, None),
|
|
212
227
|
}
|
|
213
228
|
checker_epipolar = Checker(epipolar_schema)
|
|
214
229
|
|
|
@@ -225,30 +240,18 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
225
240
|
overloaded_conf[adv_cst.TERRAIN_A_PRIORI][adv_cst.DEM_MAX] = (
|
|
226
241
|
overloaded_conf[adv_cst.TERRAIN_A_PRIORI].get(adv_cst.DEM_MAX, None)
|
|
227
242
|
)
|
|
228
|
-
overloaded_conf[adv_cst.TERRAIN_A_PRIORI][
|
|
229
|
-
adv_cst.ALTITUDE_DELTA_MIN
|
|
230
|
-
] = overloaded_conf[adv_cst.TERRAIN_A_PRIORI].get(
|
|
231
|
-
adv_cst.ALTITUDE_DELTA_MIN, None
|
|
232
|
-
)
|
|
233
|
-
overloaded_conf[adv_cst.TERRAIN_A_PRIORI][
|
|
234
|
-
adv_cst.ALTITUDE_DELTA_MAX
|
|
235
|
-
] = overloaded_conf[adv_cst.TERRAIN_A_PRIORI].get(
|
|
236
|
-
adv_cst.ALTITUDE_DELTA_MAX, None
|
|
237
|
-
)
|
|
238
243
|
terrain_a_priori_schema = {
|
|
239
244
|
adv_cst.DEM_MEDIAN: str,
|
|
240
245
|
adv_cst.DEM_MIN: Or(str, None), # TODO mandatory with local disp
|
|
241
246
|
adv_cst.DEM_MAX: Or(str, None),
|
|
242
|
-
adv_cst.ALTITUDE_DELTA_MIN: Or(int, None),
|
|
243
|
-
adv_cst.ALTITUDE_DELTA_MAX: Or(int, None),
|
|
244
247
|
}
|
|
245
248
|
checker_terrain = Checker(terrain_a_priori_schema)
|
|
246
249
|
checker_terrain.validate(overloaded_conf[adv_cst.TERRAIN_A_PRIORI])
|
|
247
250
|
|
|
248
251
|
# check epipolar a priori for each image pair
|
|
249
|
-
if (
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
if check_epipolar_a_priori and (
|
|
253
|
+
not overloaded_conf[adv_cst.TERRAIN_A_PRIORI] in (None, {})
|
|
254
|
+
or not overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI] in (None, {})
|
|
252
255
|
):
|
|
253
256
|
validate_epipolar_a_priori(overloaded_conf, checker_epipolar)
|
|
254
257
|
|
|
@@ -258,7 +261,6 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
258
261
|
overloaded_conf[adv_cst.GEOMETRY_PLUGIN],
|
|
259
262
|
geom_plugin_without_dem_and_geoid,
|
|
260
263
|
geom_plugin_with_dem_and_geoid,
|
|
261
|
-
dem_generation_roi,
|
|
262
264
|
scaling_coeff,
|
|
263
265
|
overloaded_conf[adv_cst.LAND_COVER_MAP],
|
|
264
266
|
overloaded_conf[adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING],
|
|
@@ -356,10 +358,11 @@ def validate_epipolar_a_priori(
|
|
|
356
358
|
:type checker_epipolar: Checker
|
|
357
359
|
"""
|
|
358
360
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
if overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI] is not None:
|
|
362
|
+
for key_image_pair in overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI]:
|
|
363
|
+
checker_epipolar.validate(
|
|
364
|
+
overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI][key_image_pair]
|
|
365
|
+
)
|
|
363
366
|
|
|
364
367
|
|
|
365
368
|
def check_ground_truth_dsm_data(conf):
|
|
@@ -440,22 +443,23 @@ def check_ground_truth_dsm_data(conf):
|
|
|
440
443
|
raise RuntimeError("interpolator does not exist")
|
|
441
444
|
|
|
442
445
|
|
|
443
|
-
def update_conf(
|
|
446
|
+
def update_conf( # pylint: disable=too-many-positional-arguments # noqa: C901
|
|
444
447
|
conf,
|
|
445
448
|
grid_correction_coef=None,
|
|
449
|
+
reference_dem=None,
|
|
446
450
|
dmin=None,
|
|
447
451
|
dmax=None,
|
|
448
452
|
pair_key=None,
|
|
449
453
|
dem_median=None,
|
|
450
454
|
dem_min=None,
|
|
451
455
|
dem_max=None,
|
|
452
|
-
altitude_delta_max=None,
|
|
453
|
-
altitude_delta_min=None,
|
|
454
456
|
):
|
|
455
457
|
"""
|
|
456
458
|
Update the conf with grid correction and disparity range
|
|
457
459
|
:param grid_correction_coef: grid correction coefficient
|
|
458
460
|
:type grid_correction_coef: list
|
|
461
|
+
:param reference_dem: Dem used to compute epipolar grids
|
|
462
|
+
:type reference_dem: str
|
|
459
463
|
:param dmin: disparity range minimum
|
|
460
464
|
:type dmin: float
|
|
461
465
|
:param dmax: disparity range maximum
|
|
@@ -465,9 +469,18 @@ def update_conf(
|
|
|
465
469
|
"""
|
|
466
470
|
|
|
467
471
|
if pair_key is not None:
|
|
472
|
+
if ADVANCED not in conf:
|
|
473
|
+
conf[ADVANCED] = {}
|
|
474
|
+
if adv_cst.EPIPOLAR_A_PRIORI not in conf[ADVANCED]:
|
|
475
|
+
conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI] = {}
|
|
476
|
+
if conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI] is None:
|
|
477
|
+
conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI] = {}
|
|
468
478
|
if pair_key not in conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI]:
|
|
469
479
|
conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI][pair_key] = {}
|
|
470
|
-
if grid_correction_coef is not None:
|
|
480
|
+
if grid_correction_coef is not None and reference_dem is not None:
|
|
481
|
+
conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI][pair_key][
|
|
482
|
+
"reference_dem"
|
|
483
|
+
] = reference_dem
|
|
471
484
|
if len(grid_correction_coef) == 2:
|
|
472
485
|
conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI][pair_key][
|
|
473
486
|
"grid_correction"
|
|
@@ -491,17 +504,14 @@ def update_conf(
|
|
|
491
504
|
dmax,
|
|
492
505
|
]
|
|
493
506
|
|
|
507
|
+
if adv_cst.TERRAIN_A_PRIORI not in conf[ADVANCED]:
|
|
508
|
+
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI] = {}
|
|
509
|
+
if conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI] is None:
|
|
510
|
+
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI] = {}
|
|
511
|
+
|
|
494
512
|
if dem_median is not None:
|
|
495
513
|
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI]["dem_median"] = dem_median
|
|
496
514
|
if dem_min is not None:
|
|
497
515
|
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI]["dem_min"] = dem_min
|
|
498
516
|
if dem_max is not None:
|
|
499
517
|
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI]["dem_max"] = dem_max
|
|
500
|
-
if altitude_delta_max is not None:
|
|
501
|
-
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI][
|
|
502
|
-
"altitude_delta_max"
|
|
503
|
-
] = altitude_delta_max
|
|
504
|
-
if altitude_delta_min is not None:
|
|
505
|
-
conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI][
|
|
506
|
-
"altitude_delta_min"
|
|
507
|
-
] = altitude_delta_min
|
|
@@ -32,28 +32,25 @@ CLASSIFICATION_TO_CONFIGURATION_MAPPING = (
|
|
|
32
32
|
"classification_to_configuration_mapping"
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
USE_EPIPOLAR_A_PRIORI = "use_epipolar_a_priori"
|
|
36
35
|
EPIPOLAR_A_PRIORI = "epipolar_a_priori"
|
|
37
36
|
RESOLUTION_A_PRIORI = "resolution_a_priori"
|
|
38
37
|
GROUND_TRUTH_DSM = "ground_truth_dsm"
|
|
39
38
|
|
|
40
39
|
EPIPOLAR_RESOLUTIONS = "epipolar_resolutions"
|
|
41
40
|
|
|
42
|
-
MERGING = "merging"
|
|
43
41
|
DSM_MERGING_TILE_SIZE = "dsm_merging_tile_size"
|
|
44
42
|
|
|
45
43
|
|
|
46
44
|
# inner epipolar a priori constants
|
|
47
45
|
GRID_CORRECTION = "grid_correction"
|
|
48
46
|
DISPARITY_RANGE = "disparity_range"
|
|
47
|
+
REFERENCE_DEM = "reference_dem"
|
|
49
48
|
|
|
50
49
|
TERRAIN_A_PRIORI = "terrain_a_priori"
|
|
51
|
-
|
|
50
|
+
USE_ENDOGENOUS_DEM = "use_endogenous_dem"
|
|
52
51
|
DEM_MEDIAN = "dem_median"
|
|
53
52
|
DEM_MIN = "dem_min"
|
|
54
53
|
DEM_MAX = "dem_max"
|
|
55
|
-
ALTITUDE_DELTA_MAX = "altitude_delta_max"
|
|
56
|
-
ALTITUDE_DELTA_MIN = "altitude_delta_min"
|
|
57
54
|
|
|
58
55
|
# ground truth dsm
|
|
59
56
|
INPUT_GROUND_TRUTH_DSM = "dsm"
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# coding: utf8
|
|
3
|
+
#
|
|
4
|
+
# Copyright (c) 2020 Centre National d'Etudes Spatiales (CNES).
|
|
5
|
+
#
|
|
6
|
+
# This file is part of CARS
|
|
7
|
+
# (see https://github.com/CNES/cars).
|
|
8
|
+
#
|
|
9
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
+
# you may not use this file except in compliance with the License.
|
|
11
|
+
# You may obtain a copy of the License at
|
|
12
|
+
#
|
|
13
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
#
|
|
15
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
16
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
+
# See the License for the specific language governing permissions and
|
|
19
|
+
# limitations under the License.
|
|
20
|
+
#
|
|
21
|
+
"""
|
|
22
|
+
General application configuration module
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def get_needed_apps(
|
|
27
|
+
sensors_in_inputs, save_output_dsm, save_output_point_cloud, conf
|
|
28
|
+
):
|
|
29
|
+
"""
|
|
30
|
+
This function returns the apps needed by the CARS pipeline,
|
|
31
|
+
depending on overall parameters and the user configuration
|
|
32
|
+
"""
|
|
33
|
+
needed_applications = []
|
|
34
|
+
if sensors_in_inputs:
|
|
35
|
+
needed_applications += [
|
|
36
|
+
"grid_generation",
|
|
37
|
+
"resampling",
|
|
38
|
+
"ground_truth_reprojection",
|
|
39
|
+
"dense_match_filling",
|
|
40
|
+
"sparse_matching",
|
|
41
|
+
"dense_matching",
|
|
42
|
+
"triangulation",
|
|
43
|
+
"dem_generation",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
add_default_pc_outlier_removal = True
|
|
47
|
+
for key in conf:
|
|
48
|
+
if key.startswith("point_cloud_outlier_removal"):
|
|
49
|
+
add_default_pc_outlier_removal = False
|
|
50
|
+
needed_applications += [key]
|
|
51
|
+
|
|
52
|
+
if add_default_pc_outlier_removal:
|
|
53
|
+
needed_applications += [
|
|
54
|
+
"point_cloud_outlier_removal.1",
|
|
55
|
+
"point_cloud_outlier_removal.2",
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
if save_output_dsm or save_output_point_cloud:
|
|
59
|
+
needed_applications += ["pc_denoising"]
|
|
60
|
+
|
|
61
|
+
if save_output_dsm:
|
|
62
|
+
needed_applications += [
|
|
63
|
+
"point_cloud_rasterization",
|
|
64
|
+
"auxiliary_filling",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
for key in conf:
|
|
68
|
+
if key.startswith("dsm_filling"):
|
|
69
|
+
needed_applications += [key]
|
|
70
|
+
|
|
71
|
+
return needed_applications
|