cars 1.0.0a2__cp310-cp310-win_amd64.whl → 1.0.0a4__cp310-cp310-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.

Files changed (144) hide show
  1. cars/__init__.py +3 -3
  2. cars/applications/__init__.py +0 -3
  3. cars/applications/application.py +14 -6
  4. cars/applications/application_template.py +42 -0
  5. cars/applications/auxiliary_filling/abstract_auxiliary_filling_app.py +12 -2
  6. cars/applications/auxiliary_filling/auxiliary_filling_algo.py +2 -2
  7. cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +95 -46
  8. cars/applications/auxiliary_filling/auxiliary_filling_wrappers.py +7 -6
  9. cars/applications/dem_generation/abstract_dem_generation_app.py +9 -5
  10. cars/applications/dem_generation/dem_generation_algo.py +1 -1
  11. cars/applications/dem_generation/dem_generation_wrappers.py +44 -59
  12. cars/applications/dem_generation/dichotomic_generation_app.py +9 -6
  13. cars/applications/dem_generation/rasterization_app.py +112 -43
  14. cars/applications/dense_match_filling/__init__.py +1 -1
  15. cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +2 -15
  16. cars/applications/dense_match_filling/fill_disp_algo.py +32 -373
  17. cars/applications/dense_match_filling/fill_disp_wrappers.py +0 -343
  18. cars/applications/dense_match_filling/zero_padding_app.py +10 -5
  19. cars/applications/dense_matching/abstract_dense_matching_app.py +2 -1
  20. cars/applications/dense_matching/census_mccnn_sgm_app.py +48 -60
  21. cars/applications/dense_matching/cpp/dense_matching_cpp.cp310-win_amd64.dll.a +0 -0
  22. cars/applications/dense_matching/cpp/dense_matching_cpp.cp310-win_amd64.pyd +0 -0
  23. cars/applications/dense_matching/dense_matching_algo.py +48 -14
  24. cars/applications/dense_matching/dense_matching_wrappers.py +11 -3
  25. cars/applications/dense_matching/disparity_grid_algo.py +95 -79
  26. cars/applications/dense_matching/loaders/config_mapping.json +13 -0
  27. cars/applications/dense_matching/loaders/global_land_cover_map.tif +0 -0
  28. cars/applications/dense_matching/loaders/pandora_loader.py +169 -34
  29. cars/applications/dsm_filling/border_interpolation_app.py +11 -12
  30. cars/applications/dsm_filling/bulldozer_filling_app.py +16 -15
  31. cars/applications/dsm_filling/exogenous_filling_app.py +14 -14
  32. cars/applications/grid_generation/abstract_grid_generation_app.py +1 -1
  33. cars/applications/grid_generation/epipolar_grid_generation_app.py +4 -2
  34. cars/applications/grid_generation/grid_correction_app.py +4 -1
  35. cars/applications/grid_generation/grid_generation_algo.py +7 -2
  36. cars/applications/ground_truth_reprojection/abstract_ground_truth_reprojection_app.py +1 -1
  37. cars/applications/ground_truth_reprojection/direct_localization_app.py +2 -2
  38. cars/applications/ground_truth_reprojection/ground_truth_reprojection_algo.py +2 -1
  39. cars/applications/point_cloud_fusion/abstract_pc_fusion_app.py +0 -155
  40. cars/applications/point_cloud_fusion/mapping_to_terrain_tiles_app.py +0 -658
  41. cars/applications/point_cloud_fusion/pc_fusion_algo.py +0 -1339
  42. cars/applications/point_cloud_fusion/pc_fusion_wrappers.py +0 -869
  43. cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +11 -6
  44. cars/applications/point_cloud_outlier_removal/outlier_removal_algo.py +9 -8
  45. cars/applications/point_cloud_outlier_removal/small_components_app.py +101 -270
  46. cars/applications/point_cloud_outlier_removal/statistical_app.py +120 -277
  47. cars/applications/rasterization/abstract_pc_rasterization_app.py +2 -1
  48. cars/applications/rasterization/rasterization_algo.py +18 -6
  49. cars/applications/rasterization/rasterization_wrappers.py +2 -1
  50. cars/applications/rasterization/simple_gaussian_app.py +88 -116
  51. cars/applications/resampling/abstract_resampling_app.py +1 -1
  52. cars/applications/resampling/bicubic_resampling_app.py +3 -1
  53. cars/applications/resampling/resampling_algo.py +60 -53
  54. cars/applications/resampling/resampling_wrappers.py +3 -1
  55. cars/applications/sparse_matching/abstract_sparse_matching_app.py +1 -1
  56. cars/applications/sparse_matching/sift_app.py +5 -25
  57. cars/applications/sparse_matching/sparse_matching_algo.py +3 -2
  58. cars/applications/sparse_matching/sparse_matching_wrappers.py +1 -1
  59. cars/applications/triangulation/abstract_triangulation_app.py +1 -1
  60. cars/applications/triangulation/line_of_sight_intersection_app.py +13 -11
  61. cars/applications/triangulation/pc_transform.py +552 -0
  62. cars/applications/triangulation/triangulation_algo.py +6 -4
  63. cars/applications/triangulation/triangulation_wrappers.py +1 -0
  64. cars/bundleadjustment.py +6 -6
  65. cars/cars.py +11 -9
  66. cars/core/cars_logging.py +80 -49
  67. cars/core/constants.py +0 -1
  68. cars/core/datasets.py +5 -2
  69. cars/core/geometry/abstract_geometry.py +364 -22
  70. cars/core/geometry/shareloc_geometry.py +112 -82
  71. cars/core/inputs.py +72 -19
  72. cars/core/outputs.py +1 -1
  73. cars/core/preprocessing.py +17 -3
  74. cars/core/projection.py +126 -6
  75. cars/core/tiling.py +10 -3
  76. cars/data_structures/cars_dataset.py +12 -10
  77. cars/data_structures/corresponding_tiles_tools.py +0 -103
  78. cars/data_structures/format_transformation.py +4 -1
  79. cars/devibrate.py +6 -3
  80. cars/extractroi.py +20 -21
  81. cars/orchestrator/cluster/abstract_cluster.py +15 -5
  82. cars/orchestrator/cluster/abstract_dask_cluster.py +6 -2
  83. cars/orchestrator/cluster/dask_jobqueue_utils.py +1 -1
  84. cars/orchestrator/cluster/log_wrapper.py +149 -22
  85. cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +12 -4
  86. cars/orchestrator/cluster/mp_cluster/multiprocessing_profiler.py +2 -2
  87. cars/orchestrator/cluster/pbs_dask_cluster.py +1 -1
  88. cars/orchestrator/cluster/sequential_cluster.py +5 -4
  89. cars/orchestrator/cluster/slurm_dask_cluster.py +1 -1
  90. cars/orchestrator/orchestrator.py +15 -4
  91. cars/orchestrator/registry/id_generator.py +1 -0
  92. cars/orchestrator/registry/saver_registry.py +2 -2
  93. cars/pipelines/conf_resolution/conf_final_resolution.json +5 -3
  94. cars/pipelines/default/default_pipeline.py +461 -1052
  95. cars/pipelines/parameters/advanced_parameters.py +91 -64
  96. cars/pipelines/parameters/advanced_parameters_constants.py +6 -5
  97. cars/pipelines/parameters/application_parameters.py +71 -0
  98. cars/pipelines/parameters/depth_map_inputs.py +0 -314
  99. cars/pipelines/parameters/dsm_inputs.py +40 -4
  100. cars/pipelines/parameters/output_parameters.py +44 -8
  101. cars/pipelines/parameters/sensor_inputs.py +122 -73
  102. cars/pipelines/parameters/sensor_inputs_constants.py +0 -2
  103. cars/pipelines/parameters/sensor_loaders/__init__.py +4 -3
  104. cars/pipelines/parameters/sensor_loaders/basic_classif_loader.py +106 -0
  105. cars/pipelines/parameters/sensor_loaders/{basic_sensor_loader.py → basic_image_loader.py} +16 -22
  106. cars/pipelines/parameters/sensor_loaders/pivot_classif_loader.py +121 -0
  107. cars/pipelines/parameters/sensor_loaders/{pivot_sensor_loader.py → pivot_image_loader.py} +10 -21
  108. cars/pipelines/parameters/sensor_loaders/sensor_loader.py +4 -6
  109. cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +1 -3
  110. cars/pipelines/pipeline_template.py +1 -3
  111. cars/pipelines/unit/unit_pipeline.py +676 -1070
  112. cars/starter.py +4 -3
  113. cars-1.0.0a4.dist-info/DELVEWHEEL +2 -0
  114. {cars-1.0.0a2.dist-info → cars-1.0.0a4.dist-info}/METADATA +135 -53
  115. {cars-1.0.0a2.dist-info → cars-1.0.0a4.dist-info}/RECORD +120 -134
  116. cars.libs/libgcc_s_seh-1-b2494fcbd4d80cf2c98fdd5261f6d850.dll +0 -0
  117. cars.libs/libstdc++-6-e9b0d12ae0e9555bbae55e8dfd08c3f7.dll +0 -0
  118. cars.libs/libwinpthread-1-7882d1b093714ccdfaf4e0789a817792.dll +0 -0
  119. cars/applications/dense_match_filling/cpp/__init__.py +0 -0
  120. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp310-win_amd64.dll.a +0 -0
  121. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp310-win_amd64.pyd +0 -0
  122. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.py +0 -72
  123. cars/applications/dense_match_filling/cpp/includes/dense_match_filling.hpp +0 -46
  124. cars/applications/dense_match_filling/cpp/meson.build +0 -9
  125. cars/applications/dense_match_filling/cpp/src/bindings.cpp +0 -11
  126. cars/applications/dense_match_filling/cpp/src/dense_match_filling.cpp +0 -142
  127. cars/applications/dense_match_filling/plane_app.py +0 -556
  128. cars/applications/hole_detection/__init__.py +0 -30
  129. cars/applications/hole_detection/abstract_hole_detection_app.py +0 -125
  130. cars/applications/hole_detection/cloud_to_bbox_app.py +0 -346
  131. cars/applications/hole_detection/hole_detection_algo.py +0 -144
  132. cars/applications/hole_detection/hole_detection_wrappers.py +0 -53
  133. cars/applications/point_cloud_denoising/__init__.py +0 -29
  134. cars/applications/point_cloud_denoising/abstract_pc_denoising_app.py +0 -273
  135. cars/applications/point_cloud_fusion/__init__.py +0 -30
  136. cars/applications/point_cloud_fusion/cloud_fusion_constants.py +0 -39
  137. cars/applications/sparse_matching/pandora_sparse_matching_app.py +0 -0
  138. cars/pipelines/parameters/depth_map_inputs_constants.py +0 -25
  139. cars-1.0.0a2.dist-info/DELVEWHEEL +0 -2
  140. cars.libs/libgcc_s_seh-1-f2b6825d483bdf14050493af93b5997d.dll +0 -0
  141. cars.libs/libstdc++-6-6b0059df6bc601df5a0f18a5805eea05.dll +0 -0
  142. cars.libs/libwinpthread-1-e01b8e85fd67c2b861f64d4ccc7df607.dll +0 -0
  143. {cars-1.0.0a2.dist-info → cars-1.0.0a4.dist-info}/WHEEL +0 -0
  144. {cars-1.0.0a2.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 depth_map_inputs
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 check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
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
 
@@ -60,21 +77,35 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
60
77
  adv_cst.SAVE_INTERMEDIATE_DATA, False
61
78
  )
62
79
 
80
+ overloaded_conf[adv_cst.LAND_COVER_MAP] = conf.get(
81
+ adv_cst.LAND_COVER_MAP, "global_land_cover_map.tif"
82
+ )
83
+
63
84
  overloaded_conf[adv_cst.KEEP_LOW_RES_DIR] = conf.get(
64
- adv_cst.KEEP_LOW_RES_DIR, True
85
+ adv_cst.KEEP_LOW_RES_DIR,
86
+ bool(overloaded_conf[adv_cst.SAVE_INTERMEDIATE_DATA]),
65
87
  )
66
88
 
67
89
  overloaded_conf[adv_cst.DEBUG_WITH_ROI] = conf.get(
68
90
  adv_cst.DEBUG_WITH_ROI, False
69
91
  )
70
92
 
93
+ overloaded_conf[adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING] = conf.get(
94
+ adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING, "config_mapping.json"
95
+ )
96
+
71
97
  overloaded_conf[adv_cst.PHASING] = conf.get(adv_cst.PHASING, None)
72
98
 
73
- overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS] = conf.get(
74
- adv_cst.EPIPOLAR_RESOLUTIONS, [16, 4, 1]
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,
75
107
  )
76
108
 
77
- overloaded_conf[adv_cst.MERGING] = conf.get(adv_cst.MERGING, False)
78
109
  overloaded_conf[adv_cst.DSM_MERGING_TILE_SIZE] = conf.get(
79
110
  adv_cst.DSM_MERGING_TILE_SIZE, 4000
80
111
  )
@@ -116,34 +147,25 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
116
147
  check_ground_truth_dsm_data(overloaded_conf[adv_cst.GROUND_TRUTH_DSM])
117
148
 
118
149
  if check_epipolar_a_priori:
119
- # Check conf use_epipolar_a_priori
120
- overloaded_conf[adv_cst.USE_EPIPOLAR_A_PRIORI] = conf.get(
121
- adv_cst.USE_EPIPOLAR_A_PRIORI, False
122
- )
123
150
  # Retrieve epipolar_a_priori if it is provided
124
151
  overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI] = conf.get(
125
- adv_cst.EPIPOLAR_A_PRIORI, {}
152
+ adv_cst.EPIPOLAR_A_PRIORI, None
126
153
  )
127
154
  # Retrieve terrain_a_priori if it is provided
128
155
  overloaded_conf[adv_cst.TERRAIN_A_PRIORI] = conf.get(
129
- adv_cst.TERRAIN_A_PRIORI, {}
156
+ adv_cst.TERRAIN_A_PRIORI, None
130
157
  )
131
158
 
132
159
  # Check geometry plugin
133
160
  geom_plugin_without_dem_and_geoid = None
134
161
  geom_plugin_with_dem_and_geoid = None
135
- dem_generation_roi = None
136
-
137
- # If use a priori, override initial elevation with dem_median
138
- if adv_cst.USE_EPIPOLAR_A_PRIORI in overloaded_conf:
139
- if overloaded_conf[adv_cst.USE_EPIPOLAR_A_PRIORI]:
140
- if adv_cst.DEM_MEDIAN in overloaded_conf[adv_cst.TERRAIN_A_PRIORI]:
141
- inputs[sens_cst.INITIAL_ELEVATION][sens_cst.DEM_PATH] = (
142
- overloaded_conf[adv_cst.TERRAIN_A_PRIORI][
143
- adv_cst.DEM_MEDIAN
144
- ]
145
- )
146
162
 
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]
147
169
  if inputs[sens_cst.SENSORS] is not None:
148
170
  # Check geometry plugin and overwrite geomodel in conf inputs
149
171
  (
@@ -151,17 +173,22 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
151
173
  overloaded_conf[adv_cst.GEOMETRY_PLUGIN],
152
174
  geom_plugin_without_dem_and_geoid,
153
175
  geom_plugin_with_dem_and_geoid,
154
- dem_generation_roi,
176
+ scaling_coeff,
155
177
  ) = sensor_inputs.check_geometry_plugin(
156
- inputs, conf.get(adv_cst.GEOMETRY_PLUGIN, None)
178
+ inputs,
179
+ conf.get(adv_cst.GEOMETRY_PLUGIN, None),
180
+ epipolar_resolution,
181
+ output_dem_dir,
157
182
  )
158
- elif depth_cst.DEPTH_MAPS in inputs or dsm_cst.DSMS in inputs:
183
+ elif dsm_cst.DSMS in inputs:
184
+ # assume the input comes from 0.5m sensor images
185
+ scaling_coeff = 1
159
186
  # If there's an initial elevation with
160
187
  # point clouds as inputs, generate a plugin (used in dsm_filling)
161
188
  (
162
189
  overloaded_conf[adv_cst.GEOMETRY_PLUGIN],
163
190
  geom_plugin_with_dem_and_geoid,
164
- ) = depth_map_inputs.check_geometry_plugin(
191
+ ) = dsm_inputs.check_geometry_plugin(
165
192
  inputs, conf.get(adv_cst.GEOMETRY_PLUGIN, None)
166
193
  )
167
194
 
@@ -171,7 +198,6 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
171
198
  # Validate inputs
172
199
  schema = {
173
200
  adv_cst.DEBUG_WITH_ROI: bool,
174
- adv_cst.MERGING: bool,
175
201
  adv_cst.SAVE_INTERMEDIATE_DATA: Or(dict, bool),
176
202
  adv_cst.KEEP_LOW_RES_DIR: bool,
177
203
  adv_cst.GROUND_TRUTH_DSM: Or(dict, str),
@@ -182,11 +208,13 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
182
208
  adv_cst.DSM_MERGING_TILE_SIZE: And(int, lambda x: x > 0),
183
209
  adv_cst.TEXTURE_BANDS: list,
184
210
  adv_cst.EPIPOLAR_RESOLUTIONS: Or(int, list),
211
+ adv_cst.LAND_COVER_MAP: str,
212
+ adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING: str,
213
+ adv_cst.USE_ENDOGENOUS_DEM: bool,
185
214
  }
186
215
  if check_epipolar_a_priori:
187
- schema[adv_cst.USE_EPIPOLAR_A_PRIORI] = bool
188
- schema[adv_cst.EPIPOLAR_A_PRIORI] = dict
189
- 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)
190
218
 
191
219
  checker_advanced_parameters = Checker(schema)
192
220
  checker_advanced_parameters.validate(overloaded_conf)
@@ -195,6 +223,7 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
195
223
  epipolar_schema = {
196
224
  adv_cst.GRID_CORRECTION: Or(list, None),
197
225
  adv_cst.DISPARITY_RANGE: list,
226
+ adv_cst.REFERENCE_DEM: Or(str, None),
198
227
  }
199
228
  checker_epipolar = Checker(epipolar_schema)
200
229
 
@@ -211,30 +240,18 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
211
240
  overloaded_conf[adv_cst.TERRAIN_A_PRIORI][adv_cst.DEM_MAX] = (
212
241
  overloaded_conf[adv_cst.TERRAIN_A_PRIORI].get(adv_cst.DEM_MAX, None)
213
242
  )
214
- overloaded_conf[adv_cst.TERRAIN_A_PRIORI][
215
- adv_cst.ALTITUDE_DELTA_MIN
216
- ] = overloaded_conf[adv_cst.TERRAIN_A_PRIORI].get(
217
- adv_cst.ALTITUDE_DELTA_MIN, None
218
- )
219
- overloaded_conf[adv_cst.TERRAIN_A_PRIORI][
220
- adv_cst.ALTITUDE_DELTA_MAX
221
- ] = overloaded_conf[adv_cst.TERRAIN_A_PRIORI].get(
222
- adv_cst.ALTITUDE_DELTA_MAX, None
223
- )
224
243
  terrain_a_priori_schema = {
225
244
  adv_cst.DEM_MEDIAN: str,
226
245
  adv_cst.DEM_MIN: Or(str, None), # TODO mandatory with local disp
227
246
  adv_cst.DEM_MAX: Or(str, None),
228
- adv_cst.ALTITUDE_DELTA_MIN: Or(int, None),
229
- adv_cst.ALTITUDE_DELTA_MAX: Or(int, None),
230
247
  }
231
248
  checker_terrain = Checker(terrain_a_priori_schema)
232
249
  checker_terrain.validate(overloaded_conf[adv_cst.TERRAIN_A_PRIORI])
233
250
 
234
251
  # check epipolar a priori for each image pair
235
- if (
236
- check_epipolar_a_priori
237
- and overloaded_conf[adv_cst.USE_EPIPOLAR_A_PRIORI]
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, {})
238
255
  ):
239
256
  validate_epipolar_a_priori(overloaded_conf, checker_epipolar)
240
257
 
@@ -244,7 +261,9 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
244
261
  overloaded_conf[adv_cst.GEOMETRY_PLUGIN],
245
262
  geom_plugin_without_dem_and_geoid,
246
263
  geom_plugin_with_dem_and_geoid,
247
- dem_generation_roi,
264
+ scaling_coeff,
265
+ overloaded_conf[adv_cst.LAND_COVER_MAP],
266
+ overloaded_conf[adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING],
248
267
  )
249
268
 
250
269
 
@@ -339,10 +358,11 @@ def validate_epipolar_a_priori(
339
358
  :type checker_epipolar: Checker
340
359
  """
341
360
 
342
- for key_image_pair in overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI]:
343
- checker_epipolar.validate(
344
- overloaded_conf[adv_cst.EPIPOLAR_A_PRIORI][key_image_pair]
345
- )
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
+ )
346
366
 
347
367
 
348
368
  def check_ground_truth_dsm_data(conf):
@@ -423,22 +443,23 @@ def check_ground_truth_dsm_data(conf):
423
443
  raise RuntimeError("interpolator does not exist")
424
444
 
425
445
 
426
- def update_conf(
446
+ def update_conf( # pylint: disable=too-many-positional-arguments # noqa: C901
427
447
  conf,
428
448
  grid_correction_coef=None,
449
+ reference_dem=None,
429
450
  dmin=None,
430
451
  dmax=None,
431
452
  pair_key=None,
432
453
  dem_median=None,
433
454
  dem_min=None,
434
455
  dem_max=None,
435
- altitude_delta_max=None,
436
- altitude_delta_min=None,
437
456
  ):
438
457
  """
439
458
  Update the conf with grid correction and disparity range
440
459
  :param grid_correction_coef: grid correction coefficient
441
460
  :type grid_correction_coef: list
461
+ :param reference_dem: Dem used to compute epipolar grids
462
+ :type reference_dem: str
442
463
  :param dmin: disparity range minimum
443
464
  :type dmin: float
444
465
  :param dmax: disparity range maximum
@@ -448,9 +469,18 @@ def update_conf(
448
469
  """
449
470
 
450
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] = {}
451
478
  if pair_key not in conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI]:
452
479
  conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI][pair_key] = {}
453
- 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
454
484
  if len(grid_correction_coef) == 2:
455
485
  conf[ADVANCED][adv_cst.EPIPOLAR_A_PRIORI][pair_key][
456
486
  "grid_correction"
@@ -474,17 +504,14 @@ def update_conf(
474
504
  dmax,
475
505
  ]
476
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
+
477
512
  if dem_median is not None:
478
513
  conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI]["dem_median"] = dem_median
479
514
  if dem_min is not None:
480
515
  conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI]["dem_min"] = dem_min
481
516
  if dem_max is not None:
482
517
  conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI]["dem_max"] = dem_max
483
- if altitude_delta_max is not None:
484
- conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI][
485
- "altitude_delta_max"
486
- ] = altitude_delta_max
487
- if altitude_delta_min is not None:
488
- conf[ADVANCED][adv_cst.TERRAIN_A_PRIORI][
489
- "altitude_delta_min"
490
- ] = altitude_delta_min
@@ -27,29 +27,30 @@ SAVE_INTERMEDIATE_DATA = "save_intermediate_data"
27
27
  KEEP_LOW_RES_DIR = "keep_low_res_dir"
28
28
  PHASING = "phasing"
29
29
  DEBUG_WITH_ROI = "debug_with_roi"
30
+ LAND_COVER_MAP = "land_cover_map"
31
+ CLASSIFICATION_TO_CONFIGURATION_MAPPING = (
32
+ "classification_to_configuration_mapping"
33
+ )
30
34
 
31
- USE_EPIPOLAR_A_PRIORI = "use_epipolar_a_priori"
32
35
  EPIPOLAR_A_PRIORI = "epipolar_a_priori"
33
36
  RESOLUTION_A_PRIORI = "resolution_a_priori"
34
37
  GROUND_TRUTH_DSM = "ground_truth_dsm"
35
38
 
36
39
  EPIPOLAR_RESOLUTIONS = "epipolar_resolutions"
37
40
 
38
- MERGING = "merging"
39
41
  DSM_MERGING_TILE_SIZE = "dsm_merging_tile_size"
40
42
 
41
43
 
42
44
  # inner epipolar a priori constants
43
45
  GRID_CORRECTION = "grid_correction"
44
46
  DISPARITY_RANGE = "disparity_range"
47
+ REFERENCE_DEM = "reference_dem"
45
48
 
46
49
  TERRAIN_A_PRIORI = "terrain_a_priori"
47
-
50
+ USE_ENDOGENOUS_DEM = "use_endogenous_dem"
48
51
  DEM_MEDIAN = "dem_median"
49
52
  DEM_MIN = "dem_min"
50
53
  DEM_MAX = "dem_max"
51
- ALTITUDE_DELTA_MAX = "altitude_delta_max"
52
- ALTITUDE_DELTA_MIN = "altitude_delta_min"
53
54
 
54
55
  # ground truth dsm
55
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