cars 1.0.0a1__cp313-cp313-win_amd64.whl → 1.0.0a3__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 +4 -4
- cars/applications/application.py +14 -6
- cars/applications/application_template.py +22 -0
- cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +15 -10
- cars/applications/auxiliary_filling/auxiliary_filling_wrappers.py +7 -6
- cars/applications/dem_generation/abstract_dem_generation_app.py +9 -5
- cars/applications/dem_generation/dem_generation_wrappers.py +48 -25
- cars/applications/dem_generation/dichotomic_generation_app.py +27 -9
- cars/applications/dem_generation/rasterization_app.py +85 -32
- cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +4 -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/fill_disp_algo.py +41 -12
- cars/applications/dense_match_filling/plane_app.py +11 -0
- cars/applications/dense_match_filling/zero_padding_app.py +11 -1
- cars/applications/dense_matching/census_mccnn_sgm_app.py +254 -548
- 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 +59 -11
- cars/applications/dense_matching/dense_matching_wrappers.py +51 -31
- cars/applications/dense_matching/disparity_grid_algo.py +566 -0
- cars/applications/dense_matching/loaders/config_mapping.json +13 -0
- cars/applications/dense_matching/loaders/global_land_cover_map.tif +0 -0
- cars/applications/dense_matching/loaders/pandora_loader.py +78 -1
- cars/applications/dsm_filling/border_interpolation_app.py +10 -5
- cars/applications/dsm_filling/bulldozer_filling_app.py +14 -7
- cars/applications/dsm_filling/exogenous_filling_app.py +10 -5
- cars/applications/grid_generation/grid_correction_app.py +0 -53
- cars/applications/grid_generation/transform_grid.py +5 -5
- cars/applications/point_cloud_fusion/pc_fusion_algo.py +17 -11
- cars/applications/point_cloud_fusion/pc_fusion_wrappers.py +3 -4
- cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +9 -5
- cars/applications/point_cloud_outlier_removal/small_components_app.py +5 -3
- cars/applications/point_cloud_outlier_removal/statistical_app.py +4 -2
- cars/applications/rasterization/abstract_pc_rasterization_app.py +1 -0
- cars/applications/rasterization/rasterization_algo.py +20 -27
- cars/applications/rasterization/rasterization_wrappers.py +6 -5
- cars/applications/rasterization/simple_gaussian_app.py +30 -17
- cars/applications/resampling/resampling_algo.py +44 -49
- cars/applications/sparse_matching/sift_app.py +2 -22
- cars/applications/sparse_matching/sparse_matching_wrappers.py +0 -49
- cars/applications/triangulation/line_of_sight_intersection_app.py +1 -1
- cars/applications/triangulation/triangulation_wrappers.py +2 -1
- cars/bundleadjustment.py +51 -11
- cars/cars.py +15 -5
- cars/core/constants.py +1 -1
- cars/core/geometry/abstract_geometry.py +166 -12
- cars/core/geometry/shareloc_geometry.py +61 -14
- cars/core/inputs.py +15 -0
- cars/core/projection.py +117 -0
- cars/data_structures/cars_dataset.py +7 -5
- cars/orchestrator/cluster/log_wrapper.py +1 -1
- cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +1 -1
- cars/orchestrator/orchestrator.py +1 -1
- cars/orchestrator/registry/saver_registry.py +0 -78
- cars/pipelines/default/default_pipeline.py +69 -52
- cars/pipelines/parameters/advanced_parameters.py +17 -0
- cars/pipelines/parameters/advanced_parameters_constants.py +4 -0
- cars/pipelines/parameters/depth_map_inputs.py +22 -67
- cars/pipelines/parameters/dsm_inputs.py +16 -29
- cars/pipelines/parameters/output_parameters.py +44 -8
- cars/pipelines/parameters/sensor_inputs.py +117 -24
- cars/pipelines/parameters/sensor_loaders/basic_sensor_loader.py +3 -3
- cars/pipelines/parameters/sensor_loaders/pivot_sensor_loader.py +2 -2
- cars/pipelines/parameters/sensor_loaders/sensor_loader.py +4 -6
- cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +2 -2
- cars/pipelines/pipeline.py +8 -8
- cars/pipelines/unit/unit_pipeline.py +276 -274
- cars/starter.py +20 -1
- cars-1.0.0a3.dist-info/DELVEWHEEL +2 -0
- {cars-1.0.0a1.dist-info → cars-1.0.0a3.dist-info}/METADATA +3 -2
- {cars-1.0.0a1.dist-info → cars-1.0.0a3.dist-info}/RECORD +77 -74
- 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.0a1.dist-info/DELVEWHEEL +0 -2
- cars.libs/libgcc_s_seh-1-f2b6825d483bdf14050493af93b5997d.dll +0 -0
- cars.libs/libstdc++-6-6b0059df6bc601df5a0f18a5805eea05.dll +0 -0
- cars.libs/libwinpthread-1-e01b8e85fd67c2b861f64d4ccc7df607.dll +0 -0
- {cars-1.0.0a1.dist-info → cars-1.0.0a3.dist-info}/WHEEL +0 -0
- {cars-1.0.0a1.dist-info → cars-1.0.0a3.dist-info}/entry_points.txt +0 -0
|
@@ -28,8 +28,6 @@ import logging
|
|
|
28
28
|
import os
|
|
29
29
|
import traceback
|
|
30
30
|
|
|
31
|
-
from cars.core import constants as cst
|
|
32
|
-
|
|
33
31
|
# CARS imports
|
|
34
32
|
from cars.orchestrator.registry.abstract_registry import (
|
|
35
33
|
AbstractCarsDatasetRegistry,
|
|
@@ -291,21 +289,6 @@ class SingleCarsDatasetSaver:
|
|
|
291
289
|
try:
|
|
292
290
|
if self.cars_ds.dataset_type == "arrays":
|
|
293
291
|
if not self.already_seen:
|
|
294
|
-
self.add_confidences(future_result, cst.RASTER_CONFIDENCE)
|
|
295
|
-
self.add_confidences(future_result, cst.RASTER_AMBIGUITY)
|
|
296
|
-
|
|
297
|
-
# delete doublon because of the confidences adding
|
|
298
|
-
for index, value in enumerate(self.file_names):
|
|
299
|
-
if (
|
|
300
|
-
cst.RASTER_AMBIGUITY in value
|
|
301
|
-
and cst.DSM_ALT not in value
|
|
302
|
-
and "depth_map" not in value
|
|
303
|
-
):
|
|
304
|
-
self.tags.pop(index)
|
|
305
|
-
self.dtypes.pop(index)
|
|
306
|
-
self.nodatas.pop(index)
|
|
307
|
-
self.file_names.pop(index)
|
|
308
|
-
|
|
309
292
|
# generate descriptors
|
|
310
293
|
for count, file_name in enumerate(self.file_names):
|
|
311
294
|
if self.tags[count] in future_result.keys():
|
|
@@ -340,22 +323,6 @@ class SingleCarsDatasetSaver:
|
|
|
340
323
|
elif self.cars_ds.dataset_type == "points":
|
|
341
324
|
# type points
|
|
342
325
|
if not self.already_seen:
|
|
343
|
-
# get the confidence tags available in future result
|
|
344
|
-
self.add_confidences(future_result, cst.RASTER_CONFIDENCE)
|
|
345
|
-
self.add_confidences(future_result, cst.RASTER_AMBIGUITY)
|
|
346
|
-
|
|
347
|
-
# delete doublon because of the confidences adding
|
|
348
|
-
for index, value in enumerate(self.file_names):
|
|
349
|
-
if (
|
|
350
|
-
cst.RASTER_AMBIGUITY in value
|
|
351
|
-
and cst.DSM_ALT not in value
|
|
352
|
-
and "depth_map" not in value
|
|
353
|
-
):
|
|
354
|
-
self.tags.pop(index)
|
|
355
|
-
self.dtypes.pop(index)
|
|
356
|
-
self.nodatas.pop(index)
|
|
357
|
-
self.file_names.pop(index)
|
|
358
|
-
|
|
359
326
|
# create tmp_folder
|
|
360
327
|
self.folder_name = self.file_names[0]
|
|
361
328
|
if not os.path.exists(self.folder_name):
|
|
@@ -380,51 +347,6 @@ class SingleCarsDatasetSaver:
|
|
|
380
347
|
logging.error(traceback.format_exc())
|
|
381
348
|
logging.error("Tile not saved")
|
|
382
349
|
|
|
383
|
-
def add_confidences(self, future_result, confidence_type):
|
|
384
|
-
"""
|
|
385
|
-
Add all confidence data in the register
|
|
386
|
-
Read confidence from future result outputs and rewrite
|
|
387
|
-
the confidence registered values
|
|
388
|
-
"""
|
|
389
|
-
|
|
390
|
-
def test_conf(val):
|
|
391
|
-
"""
|
|
392
|
-
Check if val key string contains confidence subtring
|
|
393
|
-
"""
|
|
394
|
-
if isinstance(val, str):
|
|
395
|
-
return confidence_type in val
|
|
396
|
-
return False
|
|
397
|
-
|
|
398
|
-
confidence_tags = list(filter(test_conf, future_result.keys()))
|
|
399
|
-
|
|
400
|
-
index = None
|
|
401
|
-
if confidence_type in self.tags:
|
|
402
|
-
# get the confidence indexes in the registered tag
|
|
403
|
-
index_table = [
|
|
404
|
-
idx
|
|
405
|
-
for idx, value in enumerate(self.tags)
|
|
406
|
-
if value == confidence_type
|
|
407
|
-
] # self.tags.index("confidence")
|
|
408
|
-
for index in reversed(index_table):
|
|
409
|
-
ref_confidence_path = self.file_names[index]
|
|
410
|
-
confidence_dtype = self.dtypes[index]
|
|
411
|
-
confidence_nodatas = self.nodatas[index]
|
|
412
|
-
# delete the generic confidence registered values
|
|
413
|
-
self.tags.pop(index)
|
|
414
|
-
self.dtypes.pop(index)
|
|
415
|
-
self.nodatas.pop(index)
|
|
416
|
-
self.file_names.pop(index)
|
|
417
|
-
self.optional_data_list.pop(index)
|
|
418
|
-
for item in confidence_tags:
|
|
419
|
-
self.tags.append(item)
|
|
420
|
-
self.file_names.append(
|
|
421
|
-
ref_confidence_path.replace(
|
|
422
|
-
confidence_type, item.replace(".", "_")
|
|
423
|
-
)
|
|
424
|
-
)
|
|
425
|
-
self.dtypes.append(confidence_dtype)
|
|
426
|
-
self.nodatas.append(confidence_nodatas)
|
|
427
|
-
|
|
428
350
|
def cleanup(self):
|
|
429
351
|
"""
|
|
430
352
|
Cleanup function
|
|
@@ -80,7 +80,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
80
80
|
|
|
81
81
|
# pylint: disable=too-many-instance-attributes
|
|
82
82
|
|
|
83
|
-
def __init__(self, conf,
|
|
83
|
+
def __init__(self, conf, config_dir=None): # noqa: C901
|
|
84
84
|
"""
|
|
85
85
|
Creates pipeline
|
|
86
86
|
|
|
@@ -99,13 +99,17 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
99
99
|
:type pipeline_name: str
|
|
100
100
|
:param cfg: configuration {'matching_cost_method': value}
|
|
101
101
|
:type cfg: dictionary
|
|
102
|
-
:param
|
|
103
|
-
:type
|
|
102
|
+
:param config_dir: path to dir containing json or yaml file
|
|
103
|
+
:type config_dir: str
|
|
104
104
|
"""
|
|
105
105
|
|
|
106
106
|
# Used conf
|
|
107
107
|
self.used_conf = {}
|
|
108
108
|
|
|
109
|
+
# Transform relative path to absolute path
|
|
110
|
+
if config_dir is not None:
|
|
111
|
+
config_dir = os.path.abspath(config_dir)
|
|
112
|
+
|
|
109
113
|
# Check global conf
|
|
110
114
|
self.check_global_schema(conf)
|
|
111
115
|
|
|
@@ -114,12 +118,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
114
118
|
# So we do the check once
|
|
115
119
|
|
|
116
120
|
# Check conf inputs
|
|
117
|
-
inputs = self.check_inputs(
|
|
118
|
-
conf[INPUTS], config_json_dir=config_json_dir
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
# Check conf output
|
|
122
|
-
output = self.check_output(conf[OUTPUT])
|
|
121
|
+
inputs = self.check_inputs(conf[INPUTS], config_dir=config_dir)
|
|
123
122
|
|
|
124
123
|
# Check advanced parameters
|
|
125
124
|
# TODO static method in the base class
|
|
@@ -130,10 +129,19 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
130
129
|
self.geom_plugin_without_dem_and_geoid,
|
|
131
130
|
self.geom_plugin_with_dem_and_geoid,
|
|
132
131
|
_,
|
|
132
|
+
self.scaling_coeff,
|
|
133
|
+
_,
|
|
134
|
+
_,
|
|
133
135
|
) = advanced_parameters.check_advanced_parameters(
|
|
134
136
|
inputs, conf.get(ADVANCED, {}), check_epipolar_a_priori=True
|
|
135
137
|
)
|
|
136
138
|
|
|
139
|
+
# Check conf output
|
|
140
|
+
(
|
|
141
|
+
output,
|
|
142
|
+
self.scaling_coeff,
|
|
143
|
+
) = self.check_output(conf[OUTPUT], self.scaling_coeff)
|
|
144
|
+
|
|
137
145
|
resolutions = advanced["epipolar_resolutions"]
|
|
138
146
|
if isinstance(resolutions, int):
|
|
139
147
|
resolutions = [resolutions]
|
|
@@ -252,20 +260,6 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
252
260
|
# (except the last one)
|
|
253
261
|
self.used_conf[key][OUTPUT][out_cst.PRODUCT_LEVEL] = "dsm"
|
|
254
262
|
|
|
255
|
-
# The idea is to calculate the less possible things
|
|
256
|
-
# So we override those parameters
|
|
257
|
-
self.used_conf[key][ADVANCED][adv_cst.MERGING] = False
|
|
258
|
-
self.used_conf[key][ADVANCED][adv_cst.PHASING] = None
|
|
259
|
-
self.used_conf[key][OUTPUT][out_cst.SAVE_BY_PAIR] = False
|
|
260
|
-
|
|
261
|
-
aux_items = self.used_conf[key][OUTPUT][
|
|
262
|
-
out_cst.AUXILIARY
|
|
263
|
-
].items()
|
|
264
|
-
for aux_key, _ in aux_items:
|
|
265
|
-
if aux_key not in ("dem_min", "dem_max", "dem_median"):
|
|
266
|
-
self.used_conf[key][OUTPUT][out_cst.AUXILIARY][
|
|
267
|
-
aux_key
|
|
268
|
-
] = False
|
|
269
263
|
else:
|
|
270
264
|
# If save_intermediate_data is true,
|
|
271
265
|
# we save the depth_maps also to debug
|
|
@@ -523,15 +517,15 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
523
517
|
logging.warning(log_msg)
|
|
524
518
|
|
|
525
519
|
@staticmethod
|
|
526
|
-
def check_inputs(conf,
|
|
520
|
+
def check_inputs(conf, config_dir=None):
|
|
527
521
|
"""
|
|
528
522
|
Check the inputs given
|
|
529
523
|
|
|
530
524
|
:param conf: configuration of inputs
|
|
531
525
|
:type conf: dict
|
|
532
|
-
:param
|
|
526
|
+
:param config_dir: directory of used json, if
|
|
533
527
|
user filled paths with relative paths
|
|
534
|
-
:type
|
|
528
|
+
:type config_dir: str
|
|
535
529
|
|
|
536
530
|
:return: overloaded inputs
|
|
537
531
|
:rtype: dict
|
|
@@ -544,36 +538,36 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
544
538
|
and dsm_cst.DSMS not in conf
|
|
545
539
|
):
|
|
546
540
|
output_config = sensor_inputs.sensors_check_inputs(
|
|
547
|
-
conf,
|
|
541
|
+
conf, config_dir=config_dir
|
|
548
542
|
)
|
|
549
543
|
elif depth_cst.DEPTH_MAPS in conf:
|
|
550
544
|
output_config = {
|
|
551
545
|
**output_config,
|
|
552
546
|
**depth_map_inputs.check_depth_maps_inputs(
|
|
553
|
-
conf,
|
|
547
|
+
conf, config_dir=config_dir
|
|
554
548
|
),
|
|
555
549
|
}
|
|
556
550
|
else:
|
|
557
551
|
output_config = {
|
|
558
552
|
**output_config,
|
|
559
|
-
**dsm_inputs.check_dsm_inputs(
|
|
560
|
-
conf, config_json_dir=config_json_dir
|
|
561
|
-
),
|
|
553
|
+
**dsm_inputs.check_dsm_inputs(conf, config_dir=config_dir),
|
|
562
554
|
}
|
|
563
555
|
return output_config
|
|
564
556
|
|
|
565
557
|
@staticmethod
|
|
566
|
-
def check_output(conf):
|
|
558
|
+
def check_output(conf, scaling_coeff):
|
|
567
559
|
"""
|
|
568
560
|
Check the output given
|
|
569
561
|
|
|
570
562
|
:param conf: configuration of output
|
|
571
563
|
:type conf: dict
|
|
564
|
+
:param scaling_coeff: scaling factor for resolution
|
|
565
|
+
:type scaling_coeff: float
|
|
572
566
|
|
|
573
567
|
:return overloader output
|
|
574
568
|
:rtype : dict
|
|
575
569
|
"""
|
|
576
|
-
return output_parameters.check_output_parameters(conf)
|
|
570
|
+
return output_parameters.check_output_parameters(conf, scaling_coeff)
|
|
577
571
|
|
|
578
572
|
def merge_resolution_conf(self, config1, config2):
|
|
579
573
|
"""
|
|
@@ -629,6 +623,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
629
623
|
:param conf: configuration of applications
|
|
630
624
|
:type conf: dict
|
|
631
625
|
"""
|
|
626
|
+
scaling_coeff = self.scaling_coeff
|
|
632
627
|
|
|
633
628
|
# Check if all specified applications are used
|
|
634
629
|
# Application in terrain_application are note used in
|
|
@@ -727,7 +722,9 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
727
722
|
if self.sensors_in_inputs:
|
|
728
723
|
# Epipolar grid generation
|
|
729
724
|
self.epipolar_grid_generation_application = Application(
|
|
730
|
-
"grid_generation",
|
|
725
|
+
"grid_generation",
|
|
726
|
+
cfg=used_conf.get("grid_generation", {}),
|
|
727
|
+
scaling_coeff=scaling_coeff,
|
|
731
728
|
)
|
|
732
729
|
used_conf["grid_generation"] = (
|
|
733
730
|
self.epipolar_grid_generation_application.get_conf()
|
|
@@ -736,7 +733,9 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
736
733
|
# image resampling
|
|
737
734
|
|
|
738
735
|
self.resampling_application = Application(
|
|
739
|
-
"resampling",
|
|
736
|
+
"resampling",
|
|
737
|
+
cfg=used_conf.get("resampling", {}),
|
|
738
|
+
scaling_coeff=scaling_coeff,
|
|
740
739
|
)
|
|
741
740
|
used_conf["resampling"] = self.resampling_application.get_conf()
|
|
742
741
|
|
|
@@ -758,10 +757,13 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
758
757
|
self.ground_truth_reprojection = Application(
|
|
759
758
|
"ground_truth_reprojection",
|
|
760
759
|
cfg=used_conf.get("ground_truth_reprojection", {}),
|
|
760
|
+
scaling_coeff=scaling_coeff,
|
|
761
761
|
)
|
|
762
762
|
# holes detection
|
|
763
763
|
self.hole_detection_app = Application(
|
|
764
|
-
"hole_detection",
|
|
764
|
+
"hole_detection",
|
|
765
|
+
cfg=used_conf.get("hole_detection", {}),
|
|
766
|
+
scaling_coeff=scaling_coeff,
|
|
765
767
|
)
|
|
766
768
|
used_conf["hole_detection"] = self.hole_detection_app.get_conf()
|
|
767
769
|
|
|
@@ -772,6 +774,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
772
774
|
"dense_match_filling.1",
|
|
773
775
|
{"method": "plane"},
|
|
774
776
|
),
|
|
777
|
+
scaling_coeff=scaling_coeff,
|
|
775
778
|
)
|
|
776
779
|
used_conf["dense_match_filling.1"] = (
|
|
777
780
|
self.dense_match_filling_1.get_conf()
|
|
@@ -784,6 +787,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
784
787
|
"dense_match_filling.2",
|
|
785
788
|
{"method": "zero_padding"},
|
|
786
789
|
),
|
|
790
|
+
scaling_coeff=scaling_coeff,
|
|
787
791
|
)
|
|
788
792
|
used_conf["dense_match_filling.2"] = (
|
|
789
793
|
self.dense_match_filling_2.get_conf()
|
|
@@ -793,6 +797,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
793
797
|
self.sparse_mtch_sift_app = Application(
|
|
794
798
|
"sparse_matching",
|
|
795
799
|
cfg=used_conf.get("sparse_matching.sift", {"method": "sift"}),
|
|
800
|
+
scaling_coeff=scaling_coeff,
|
|
796
801
|
)
|
|
797
802
|
used_conf["sparse_matching.sift"] = (
|
|
798
803
|
self.sparse_mtch_sift_app.get_conf()
|
|
@@ -820,7 +825,9 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
820
825
|
):
|
|
821
826
|
dense_matching_config["performance_map_method"] = "risk"
|
|
822
827
|
self.dense_matching_app = Application(
|
|
823
|
-
"dense_matching",
|
|
828
|
+
"dense_matching",
|
|
829
|
+
cfg=dense_matching_config,
|
|
830
|
+
scaling_coeff=scaling_coeff,
|
|
824
831
|
)
|
|
825
832
|
used_conf["dense_matching"] = self.dense_matching_app.get_conf()
|
|
826
833
|
|
|
@@ -830,20 +837,11 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
830
837
|
"intervals",
|
|
831
838
|
]
|
|
832
839
|
|
|
833
|
-
if res <= 16:
|
|
834
|
-
if (
|
|
835
|
-
"dense matching" not in conf
|
|
836
|
-
or "confidence filtering" not in conf["dense matching"]
|
|
837
|
-
or "lower bound"
|
|
838
|
-
not in conf["dense matching"]["confidence filtering"]
|
|
839
|
-
):
|
|
840
|
-
used_conf["dense_matching"]["confidence_filtering"][
|
|
841
|
-
"lower_bound"
|
|
842
|
-
] = -90
|
|
843
|
-
|
|
844
840
|
# Triangulation
|
|
845
841
|
self.triangulation_application = Application(
|
|
846
|
-
"triangulation",
|
|
842
|
+
"triangulation",
|
|
843
|
+
cfg=used_conf.get("triangulation", {}),
|
|
844
|
+
scaling_coeff=scaling_coeff,
|
|
847
845
|
)
|
|
848
846
|
used_conf["triangulation"] = (
|
|
849
847
|
self.triangulation_application.get_conf()
|
|
@@ -851,12 +849,22 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
851
849
|
|
|
852
850
|
# MNT generation
|
|
853
851
|
self.dem_generation_application = Application(
|
|
854
|
-
"dem_generation",
|
|
852
|
+
"dem_generation",
|
|
853
|
+
cfg=used_conf.get("dem_generation", {}),
|
|
854
|
+
scaling_coeff=scaling_coeff,
|
|
855
855
|
)
|
|
856
|
+
|
|
857
|
+
height_margin = None
|
|
858
|
+
if res >= 8 and "height_margin" not in used_conf["dem_generation"]:
|
|
859
|
+
height_margin = [50, 250]
|
|
860
|
+
|
|
856
861
|
used_conf["dem_generation"] = (
|
|
857
862
|
self.dem_generation_application.get_conf()
|
|
858
863
|
)
|
|
859
864
|
|
|
865
|
+
if height_margin is not None:
|
|
866
|
+
used_conf["dem_generation"]["height_margin"] = height_margin
|
|
867
|
+
|
|
860
868
|
# Points cloud small component outlier removal
|
|
861
869
|
if "point_cloud_outlier_removal.1" in used_conf:
|
|
862
870
|
if "method" not in used_conf["point_cloud_outlier_removal.1"]:
|
|
@@ -870,6 +878,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
870
878
|
"point_cloud_outlier_removal.1",
|
|
871
879
|
{"method": "small_components"},
|
|
872
880
|
),
|
|
881
|
+
scaling_coeff=scaling_coeff,
|
|
873
882
|
)
|
|
874
883
|
|
|
875
884
|
connection_val = None
|
|
@@ -897,6 +906,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
897
906
|
"point_cloud_outlier_removal.2",
|
|
898
907
|
{"method": "statistical"},
|
|
899
908
|
),
|
|
909
|
+
scaling_coeff=scaling_coeff,
|
|
900
910
|
)
|
|
901
911
|
used_conf["point_cloud_outlier_removal.2"] = (
|
|
902
912
|
self.pc_outlier_removal_2_app.get_conf()
|
|
@@ -908,6 +918,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
908
918
|
self.pc_denoising_application = Application(
|
|
909
919
|
"pc_denoising",
|
|
910
920
|
cfg=used_conf.get("pc_denoising", {"method": "none"}),
|
|
921
|
+
scaling_coeff=scaling_coeff,
|
|
911
922
|
)
|
|
912
923
|
used_conf["pc_denoising"] = self.pc_denoising_application.get_conf()
|
|
913
924
|
|
|
@@ -917,6 +928,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
917
928
|
self.rasterization_application = Application(
|
|
918
929
|
"point_cloud_rasterization",
|
|
919
930
|
cfg=used_conf.get("point_cloud_rasterization", {}),
|
|
931
|
+
scaling_coeff=scaling_coeff,
|
|
920
932
|
)
|
|
921
933
|
used_conf["point_cloud_rasterization"] = (
|
|
922
934
|
self.rasterization_application.get_conf()
|
|
@@ -928,6 +940,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
928
940
|
"dsm_filling.1",
|
|
929
941
|
{"method": "exogenous_filling"},
|
|
930
942
|
),
|
|
943
|
+
scaling_coeff=scaling_coeff,
|
|
931
944
|
)
|
|
932
945
|
used_conf["dsm_filling.1"] = (
|
|
933
946
|
self.dsm_filling_1_application.get_conf()
|
|
@@ -950,13 +963,16 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
950
963
|
"dsm_filling.3",
|
|
951
964
|
{"method": "border_interpolation"},
|
|
952
965
|
),
|
|
966
|
+
scaling_coeff=scaling_coeff,
|
|
953
967
|
)
|
|
954
968
|
used_conf["dsm_filling.3"] = (
|
|
955
969
|
self.dsm_filling_3_application.get_conf()
|
|
956
970
|
)
|
|
957
971
|
# Auxiliary filling
|
|
958
972
|
self.auxiliary_filling_application = Application(
|
|
959
|
-
"auxiliary_filling",
|
|
973
|
+
"auxiliary_filling",
|
|
974
|
+
cfg=conf.get("auxiliary_filling", {}),
|
|
975
|
+
scaling_coeff=scaling_coeff,
|
|
960
976
|
)
|
|
961
977
|
used_conf["auxiliary_filling"] = (
|
|
962
978
|
self.auxiliary_filling_application.get_conf()
|
|
@@ -968,6 +984,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
968
984
|
self.pc_fusion_application = Application(
|
|
969
985
|
"point_cloud_fusion",
|
|
970
986
|
cfg=used_conf.get("point_cloud_fusion", {}),
|
|
987
|
+
scaling_coeff=scaling_coeff,
|
|
971
988
|
)
|
|
972
989
|
used_conf["point_cloud_fusion"] = (
|
|
973
990
|
self.pc_fusion_application.get_conf()
|
|
@@ -1118,7 +1135,7 @@ class DefaultPipeline(PipelineTemplate):
|
|
|
1118
1135
|
size_low_res_img_col = first_image_size[1] // res
|
|
1119
1136
|
if (
|
|
1120
1137
|
"grid_generation" not in initial_conf_app
|
|
1121
|
-
or "epi_step" not in
|
|
1138
|
+
or "epi_step" not in initial_conf_app["grid_generation"]
|
|
1122
1139
|
):
|
|
1123
1140
|
if size_low_res_img_row <= 900 and size_low_res_img_col <= 900:
|
|
1124
1141
|
application_conf["grid_generation"]["epi_step"] = res * 5
|
|
@@ -60,6 +60,10 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
60
60
|
adv_cst.SAVE_INTERMEDIATE_DATA, False
|
|
61
61
|
)
|
|
62
62
|
|
|
63
|
+
overloaded_conf[adv_cst.LAND_COVER_MAP] = conf.get(
|
|
64
|
+
adv_cst.LAND_COVER_MAP, "global_land_cover_map.tif"
|
|
65
|
+
)
|
|
66
|
+
|
|
63
67
|
overloaded_conf[adv_cst.KEEP_LOW_RES_DIR] = conf.get(
|
|
64
68
|
adv_cst.KEEP_LOW_RES_DIR, True
|
|
65
69
|
)
|
|
@@ -68,6 +72,10 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
68
72
|
adv_cst.DEBUG_WITH_ROI, False
|
|
69
73
|
)
|
|
70
74
|
|
|
75
|
+
overloaded_conf[adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING] = conf.get(
|
|
76
|
+
adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING, "config_mapping.json"
|
|
77
|
+
)
|
|
78
|
+
|
|
71
79
|
overloaded_conf[adv_cst.PHASING] = conf.get(adv_cst.PHASING, None)
|
|
72
80
|
|
|
73
81
|
overloaded_conf[adv_cst.EPIPOLAR_RESOLUTIONS] = conf.get(
|
|
@@ -144,6 +152,7 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
144
152
|
]
|
|
145
153
|
)
|
|
146
154
|
|
|
155
|
+
scaling_coeff = None
|
|
147
156
|
if inputs[sens_cst.SENSORS] is not None:
|
|
148
157
|
# Check geometry plugin and overwrite geomodel in conf inputs
|
|
149
158
|
(
|
|
@@ -152,10 +161,13 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
152
161
|
geom_plugin_without_dem_and_geoid,
|
|
153
162
|
geom_plugin_with_dem_and_geoid,
|
|
154
163
|
dem_generation_roi,
|
|
164
|
+
scaling_coeff,
|
|
155
165
|
) = sensor_inputs.check_geometry_plugin(
|
|
156
166
|
inputs, conf.get(adv_cst.GEOMETRY_PLUGIN, None)
|
|
157
167
|
)
|
|
158
168
|
elif depth_cst.DEPTH_MAPS in inputs or dsm_cst.DSMS in inputs:
|
|
169
|
+
# assume the input comes from 0.5m sensor images
|
|
170
|
+
scaling_coeff = 1
|
|
159
171
|
# If there's an initial elevation with
|
|
160
172
|
# point clouds as inputs, generate a plugin (used in dsm_filling)
|
|
161
173
|
(
|
|
@@ -182,6 +194,8 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
182
194
|
adv_cst.DSM_MERGING_TILE_SIZE: And(int, lambda x: x > 0),
|
|
183
195
|
adv_cst.TEXTURE_BANDS: list,
|
|
184
196
|
adv_cst.EPIPOLAR_RESOLUTIONS: Or(int, list),
|
|
197
|
+
adv_cst.LAND_COVER_MAP: str,
|
|
198
|
+
adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING: str,
|
|
185
199
|
}
|
|
186
200
|
if check_epipolar_a_priori:
|
|
187
201
|
schema[adv_cst.USE_EPIPOLAR_A_PRIORI] = bool
|
|
@@ -245,6 +259,9 @@ def check_advanced_parameters(inputs, conf, check_epipolar_a_priori=True):
|
|
|
245
259
|
geom_plugin_without_dem_and_geoid,
|
|
246
260
|
geom_plugin_with_dem_and_geoid,
|
|
247
261
|
dem_generation_roi,
|
|
262
|
+
scaling_coeff,
|
|
263
|
+
overloaded_conf[adv_cst.LAND_COVER_MAP],
|
|
264
|
+
overloaded_conf[adv_cst.CLASSIFICATION_TO_CONFIGURATION_MAPPING],
|
|
248
265
|
)
|
|
249
266
|
|
|
250
267
|
|
|
@@ -27,6 +27,10 @@ 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
35
|
USE_EPIPOLAR_A_PRIORI = "use_epipolar_a_priori"
|
|
32
36
|
EPIPOLAR_A_PRIORI = "epipolar_a_priori"
|