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.

Files changed (139) hide show
  1. cars/__init__.py +3 -3
  2. cars/applications/__init__.py +0 -3
  3. cars/applications/application_template.py +20 -0
  4. cars/applications/auxiliary_filling/abstract_auxiliary_filling_app.py +12 -2
  5. cars/applications/auxiliary_filling/auxiliary_filling_algo.py +2 -2
  6. cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +80 -36
  7. cars/applications/dem_generation/dem_generation_algo.py +1 -1
  8. cars/applications/dem_generation/dem_generation_wrappers.py +23 -57
  9. cars/applications/dem_generation/dichotomic_generation_app.py +3 -3
  10. cars/applications/dem_generation/rasterization_app.py +100 -41
  11. cars/applications/dense_match_filling/__init__.py +1 -1
  12. cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +2 -15
  13. cars/applications/dense_match_filling/fill_disp_algo.py +32 -373
  14. cars/applications/dense_match_filling/fill_disp_wrappers.py +0 -343
  15. cars/applications/dense_match_filling/zero_padding_app.py +10 -5
  16. cars/applications/dense_matching/abstract_dense_matching_app.py +2 -1
  17. cars/applications/dense_matching/census_mccnn_sgm_app.py +38 -39
  18. cars/applications/dense_matching/cpp/dense_matching_cpp.cp313-win_amd64.dll.a +0 -0
  19. cars/applications/dense_matching/cpp/dense_matching_cpp.cp313-win_amd64.pyd +0 -0
  20. cars/applications/dense_matching/dense_matching_algo.py +48 -14
  21. cars/applications/dense_matching/dense_matching_wrappers.py +11 -3
  22. cars/applications/dense_matching/disparity_grid_algo.py +84 -62
  23. cars/applications/dense_matching/loaders/pandora_loader.py +91 -33
  24. cars/applications/dsm_filling/border_interpolation_app.py +1 -7
  25. cars/applications/dsm_filling/bulldozer_filling_app.py +2 -8
  26. cars/applications/dsm_filling/exogenous_filling_app.py +4 -9
  27. cars/applications/grid_generation/abstract_grid_generation_app.py +1 -1
  28. cars/applications/grid_generation/epipolar_grid_generation_app.py +4 -2
  29. cars/applications/grid_generation/grid_correction_app.py +4 -1
  30. cars/applications/grid_generation/grid_generation_algo.py +7 -2
  31. cars/applications/ground_truth_reprojection/abstract_ground_truth_reprojection_app.py +1 -1
  32. cars/applications/ground_truth_reprojection/direct_localization_app.py +2 -2
  33. cars/applications/ground_truth_reprojection/ground_truth_reprojection_algo.py +2 -1
  34. cars/applications/point_cloud_fusion/abstract_pc_fusion_app.py +0 -155
  35. cars/applications/point_cloud_fusion/mapping_to_terrain_tiles_app.py +0 -658
  36. cars/applications/point_cloud_fusion/pc_fusion_algo.py +0 -1339
  37. cars/applications/point_cloud_fusion/pc_fusion_wrappers.py +0 -869
  38. cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +2 -1
  39. cars/applications/point_cloud_outlier_removal/outlier_removal_algo.py +9 -8
  40. cars/applications/point_cloud_outlier_removal/small_components_app.py +96 -267
  41. cars/applications/point_cloud_outlier_removal/statistical_app.py +116 -275
  42. cars/applications/rasterization/abstract_pc_rasterization_app.py +1 -1
  43. cars/applications/rasterization/rasterization_algo.py +18 -6
  44. cars/applications/rasterization/rasterization_wrappers.py +2 -1
  45. cars/applications/rasterization/simple_gaussian_app.py +60 -113
  46. cars/applications/resampling/abstract_resampling_app.py +1 -1
  47. cars/applications/resampling/bicubic_resampling_app.py +3 -1
  48. cars/applications/resampling/resampling_algo.py +16 -4
  49. cars/applications/resampling/resampling_wrappers.py +3 -1
  50. cars/applications/sparse_matching/abstract_sparse_matching_app.py +1 -1
  51. cars/applications/sparse_matching/sift_app.py +3 -3
  52. cars/applications/sparse_matching/sparse_matching_algo.py +3 -2
  53. cars/applications/sparse_matching/sparse_matching_wrappers.py +1 -1
  54. cars/applications/triangulation/abstract_triangulation_app.py +1 -1
  55. cars/applications/triangulation/line_of_sight_intersection_app.py +13 -11
  56. cars/applications/triangulation/pc_transform.py +552 -0
  57. cars/applications/triangulation/triangulation_algo.py +6 -4
  58. cars/applications/triangulation/triangulation_wrappers.py +1 -0
  59. cars/bundleadjustment.py +6 -6
  60. cars/cars.py +11 -9
  61. cars/core/cars_logging.py +80 -49
  62. cars/core/constants.py +0 -1
  63. cars/core/datasets.py +5 -2
  64. cars/core/geometry/abstract_geometry.py +256 -25
  65. cars/core/geometry/shareloc_geometry.py +110 -82
  66. cars/core/inputs.py +57 -19
  67. cars/core/outputs.py +1 -1
  68. cars/core/preprocessing.py +17 -3
  69. cars/core/projection.py +9 -6
  70. cars/core/tiling.py +10 -3
  71. cars/data_structures/cars_dataset.py +5 -5
  72. cars/data_structures/corresponding_tiles_tools.py +0 -103
  73. cars/data_structures/format_transformation.py +4 -1
  74. cars/devibrate.py +6 -3
  75. cars/extractroi.py +20 -21
  76. cars/orchestrator/cluster/abstract_cluster.py +15 -5
  77. cars/orchestrator/cluster/abstract_dask_cluster.py +6 -2
  78. cars/orchestrator/cluster/dask_jobqueue_utils.py +1 -1
  79. cars/orchestrator/cluster/log_wrapper.py +148 -21
  80. cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +11 -3
  81. cars/orchestrator/cluster/mp_cluster/multiprocessing_profiler.py +2 -2
  82. cars/orchestrator/cluster/pbs_dask_cluster.py +1 -1
  83. cars/orchestrator/cluster/sequential_cluster.py +5 -4
  84. cars/orchestrator/cluster/slurm_dask_cluster.py +1 -1
  85. cars/orchestrator/orchestrator.py +14 -3
  86. cars/orchestrator/registry/id_generator.py +1 -0
  87. cars/orchestrator/registry/saver_registry.py +2 -2
  88. cars/pipelines/conf_resolution/conf_final_resolution.json +5 -3
  89. cars/pipelines/default/default_pipeline.py +462 -1073
  90. cars/pipelines/parameters/advanced_parameters.py +74 -64
  91. cars/pipelines/parameters/advanced_parameters_constants.py +2 -5
  92. cars/pipelines/parameters/application_parameters.py +71 -0
  93. cars/pipelines/parameters/depth_map_inputs.py +0 -314
  94. cars/pipelines/parameters/dsm_inputs.py +40 -4
  95. cars/pipelines/parameters/output_parameters.py +2 -2
  96. cars/pipelines/parameters/sensor_inputs.py +30 -75
  97. cars/pipelines/parameters/sensor_inputs_constants.py +0 -2
  98. cars/pipelines/parameters/sensor_loaders/__init__.py +4 -3
  99. cars/pipelines/parameters/sensor_loaders/basic_classif_loader.py +106 -0
  100. cars/pipelines/parameters/sensor_loaders/{basic_sensor_loader.py → basic_image_loader.py} +16 -22
  101. cars/pipelines/parameters/sensor_loaders/pivot_classif_loader.py +121 -0
  102. cars/pipelines/parameters/sensor_loaders/{pivot_sensor_loader.py → pivot_image_loader.py} +10 -21
  103. cars/pipelines/parameters/sensor_loaders/sensor_loader.py +4 -6
  104. cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +1 -3
  105. cars/pipelines/pipeline_template.py +1 -3
  106. cars/pipelines/unit/unit_pipeline.py +527 -1016
  107. cars/starter.py +4 -3
  108. cars-1.0.0a4.dist-info/DELVEWHEEL +2 -0
  109. {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/METADATA +135 -53
  110. {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/RECORD +115 -131
  111. cars.libs/libgcc_s_seh-1-b2494fcbd4d80cf2c98fdd5261f6d850.dll +0 -0
  112. cars.libs/libstdc++-6-e9b0d12ae0e9555bbae55e8dfd08c3f7.dll +0 -0
  113. cars.libs/libwinpthread-1-7882d1b093714ccdfaf4e0789a817792.dll +0 -0
  114. cars/applications/dense_match_filling/cpp/__init__.py +0 -0
  115. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp313-win_amd64.dll.a +0 -0
  116. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp313-win_amd64.pyd +0 -0
  117. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.py +0 -72
  118. cars/applications/dense_match_filling/cpp/includes/dense_match_filling.hpp +0 -46
  119. cars/applications/dense_match_filling/cpp/meson.build +0 -9
  120. cars/applications/dense_match_filling/cpp/src/bindings.cpp +0 -11
  121. cars/applications/dense_match_filling/cpp/src/dense_match_filling.cpp +0 -142
  122. cars/applications/dense_match_filling/plane_app.py +0 -556
  123. cars/applications/hole_detection/__init__.py +0 -30
  124. cars/applications/hole_detection/abstract_hole_detection_app.py +0 -125
  125. cars/applications/hole_detection/cloud_to_bbox_app.py +0 -346
  126. cars/applications/hole_detection/hole_detection_algo.py +0 -144
  127. cars/applications/hole_detection/hole_detection_wrappers.py +0 -53
  128. cars/applications/point_cloud_denoising/__init__.py +0 -29
  129. cars/applications/point_cloud_denoising/abstract_pc_denoising_app.py +0 -273
  130. cars/applications/point_cloud_fusion/__init__.py +0 -30
  131. cars/applications/point_cloud_fusion/cloud_fusion_constants.py +0 -39
  132. cars/applications/sparse_matching/pandora_sparse_matching_app.py +0 -0
  133. cars/pipelines/parameters/depth_map_inputs_constants.py +0 -25
  134. cars-1.0.0a3.dist-info/DELVEWHEEL +0 -2
  135. cars.libs/libgcc_s_seh-1-ca70890bbc5723b6d0ea31e9c9cded2b.dll +0 -0
  136. cars.libs/libstdc++-6-00ee19f73d5122a1277c137b1c218401.dll +0 -0
  137. cars.libs/libwinpthread-1-f5042e8e3d21edce20c1bc99445f551b.dll +0 -0
  138. {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/WHEEL +0 -0
  139. {cars-1.0.0a3.dist-info → cars-1.0.0a4.dist-info}/entry_points.txt +0 -0
@@ -42,21 +42,25 @@ from json_checker import Checker, Or
42
42
 
43
43
  import cars.orchestrator.orchestrator as ocht
44
44
  from cars.applications import application_constants
45
- from cars.applications.point_cloud_fusion import pc_fusion_algo
46
45
 
47
46
  # CARS imports
48
- from cars.applications.rasterization import rasterization_algo
47
+ from cars.applications.rasterization import (
48
+ rasterization_algo,
49
+ )
49
50
  from cars.applications.rasterization import (
50
51
  rasterization_constants as raster_cst,
51
52
  )
52
- from cars.applications.rasterization import rasterization_wrappers
53
+ from cars.applications.rasterization import (
54
+ rasterization_wrappers,
55
+ )
53
56
  from cars.applications.rasterization.abstract_pc_rasterization_app import (
54
57
  PointCloudRasterization,
55
58
  )
59
+ from cars.applications.triangulation import pc_transform
56
60
  from cars.core import constants as cst
57
61
  from cars.core import projection, tiling
58
62
  from cars.core.utils import safe_makedirs
59
- from cars.data_structures import cars_dataset, format_transformation
63
+ from cars.data_structures import cars_dataset
60
64
 
61
65
  # R0903 temporary disabled for error "Too few public methods"
62
66
  # œgoing to be corrected by adding new methods as check_conf
@@ -204,6 +208,7 @@ class SimpleGaussian(
204
208
  )
205
209
  return tile_size
206
210
 
211
+ # pylint: disable=too-many-positional-arguments
207
212
  def run( # noqa: C901 function is too complex
208
213
  self,
209
214
  point_clouds,
@@ -363,21 +368,13 @@ class SimpleGaussian(
363
368
  out_dump_dir = self.orchestrator.out_dir
364
369
 
365
370
  # Check if input data is supported
366
- data_valid = True
367
- if isinstance(point_clouds, tuple):
368
- if isinstance(point_clouds[0][0], cars_dataset.CarsDataset):
369
- if point_clouds[0][0].dataset_type not in ("arrays", "points"):
370
- data_valid = False
371
- else:
372
- data_valid = False
373
- elif isinstance(point_clouds, cars_dataset.CarsDataset):
374
- if point_clouds.dataset_type != "points":
375
- data_valid = False
376
- else:
377
- data_valid = False
378
- if not data_valid:
371
+ if not (
372
+ isinstance(point_clouds, tuple)
373
+ and isinstance(point_clouds[0][0], cars_dataset.CarsDataset)
374
+ and point_clouds[0][0].dataset_type == "arrays"
375
+ ):
379
376
  message = (
380
- "PointCloudRasterisation application doesn't support "
377
+ "PointCloudRasterization application doesn't support "
381
378
  "this input data "
382
379
  "format : type : {}".format(type(point_clouds))
383
380
  )
@@ -389,24 +386,17 @@ class SimpleGaussian(
389
386
  "arrays", name="rasterization"
390
387
  )
391
388
 
392
- if isinstance(point_clouds, cars_dataset.CarsDataset):
393
- # Get tiling grid
394
- terrain_raster.tiling_grid = (
395
- format_transformation.terrain_coords_to_pix(
396
- point_clouds, resolution
397
- )
398
- )
399
- bounds = point_clouds.attributes["bounds"]
400
- else:
401
- bounds = point_clouds[1]
402
- # tiling grid: all tiles from sources -> not replaceable.
403
- # CarsDataset is only used for processing
404
- nb_tiles = 0
405
- for point_cld in point_clouds[0]:
406
- nb_tiles += point_cld.shape[0] * point_cld.shape[1]
407
- terrain_raster.tiling_grid = tiling.generate_tiling_grid(
408
- 0, 0, 1, nb_tiles, 1, 1
409
- )
389
+ paths_data = {}
390
+
391
+ bounds = point_clouds[1]
392
+ # tiling grid: all tiles from sources -> not replaceable.
393
+ # CarsDataset is only used for processing
394
+ nb_tiles = 0
395
+ for point_cld in point_clouds[0]:
396
+ nb_tiles += point_cld.shape[0] * point_cld.shape[1]
397
+ terrain_raster.tiling_grid = tiling.generate_tiling_grid(
398
+ 0, 0, 1, nb_tiles, 1, 1
399
+ )
410
400
 
411
401
  terrain_raster.generate_none_tiles()
412
402
 
@@ -445,6 +435,7 @@ class SimpleGaussian(
445
435
  safe_makedirs(os.path.dirname(dsm_file_name))
446
436
 
447
437
  out_dsm_file_name = dsm_file_name
438
+
448
439
  if out_dsm_file_name is not None:
449
440
  self.orchestrator.update_index(
450
441
  {
@@ -466,6 +457,7 @@ class SimpleGaussian(
466
457
  nodata=self.dsm_no_data,
467
458
  cars_ds_name="dsm",
468
459
  )
460
+ paths_data[cst.RASTER_HGT] = out_dsm_file_name
469
461
 
470
462
  out_weights_file_name = weights_file_name
471
463
  if out_weights_file_name is not None:
@@ -493,6 +485,7 @@ class SimpleGaussian(
493
485
  nodata=0,
494
486
  cars_ds_name="dsm_weights",
495
487
  )
488
+ paths_data[cst.RASTER_WEIGHTS_SUM] = out_weights_file_name
496
489
 
497
490
  out_clr_file_name = color_file_name
498
491
  if out_clr_file_name is not None:
@@ -518,6 +511,7 @@ class SimpleGaussian(
518
511
  nodata=self.texture_no_data,
519
512
  cars_ds_name="texture",
520
513
  )
514
+ paths_data[cst.RASTER_COLOR_IMG] = out_clr_file_name
521
515
 
522
516
  out_classif_file_name = classif_file_name
523
517
  if out_classif_file_name is not None:
@@ -548,6 +542,7 @@ class SimpleGaussian(
548
542
  cars_ds_name="dsm_classif",
549
543
  optional_data=True,
550
544
  )
545
+ paths_data[cst.RASTER_CLASSIF] = out_classif_file_name
551
546
 
552
547
  out_msk_file_name = mask_file_name
553
548
  if out_msk_file_name is not None:
@@ -573,6 +568,7 @@ class SimpleGaussian(
573
568
  cars_ds_name="dsm_mask",
574
569
  optional_data=True,
575
570
  )
571
+ paths_data[cst.RASTER_MSK] = out_msk_file_name
576
572
 
577
573
  out_performance_map = performance_map_file_name
578
574
 
@@ -614,6 +610,7 @@ class SimpleGaussian(
614
610
  cars_ds_name="performance_map_raw",
615
611
  optional_data=True,
616
612
  )
613
+ paths_data[cst.RASTER_PERFORMANCE_MAP_RAW] = out_performance_map_raw
617
614
  if (
618
615
  out_performance_map is not None
619
616
  and performance_map_classes is not None
@@ -629,6 +626,7 @@ class SimpleGaussian(
629
626
  cars_ds_name="performance_map",
630
627
  optional_data=True,
631
628
  )
629
+ paths_data[cst.RASTER_PERFORMANCE_MAP] = out_performance_map
632
630
 
633
631
  out_ambiguity = ambiguity_file_name
634
632
  if out_ambiguity is not None:
@@ -654,6 +652,7 @@ class SimpleGaussian(
654
652
  cars_ds_name="ambiguity",
655
653
  optional_data=True,
656
654
  )
655
+ paths_data[cst.RASTER_AMBIGUITY] = out_ambiguity
657
656
 
658
657
  out_source_pc = contributing_pair_file_name
659
658
  if out_source_pc is not None:
@@ -681,6 +680,7 @@ class SimpleGaussian(
681
680
  cars_ds_name="contributing_pair",
682
681
  optional_data=True,
683
682
  )
683
+ paths_data[cst.RASTER_SOURCE_PC] = out_source_pc
684
684
 
685
685
  out_filling = filling_file_name
686
686
  if out_filling is not None:
@@ -702,6 +702,7 @@ class SimpleGaussian(
702
702
  cars_ds_name="filling",
703
703
  optional_data=True,
704
704
  )
705
+ paths_data[cst.RASTER_FILLING] = out_filling
705
706
 
706
707
  # TODO Check that intervals indeed exist!
707
708
  if save_intermediate_data:
@@ -873,53 +874,34 @@ class SimpleGaussian(
873
874
 
874
875
  self.orchestrator.update_out_info(updating_dict)
875
876
 
876
- # Generate rasters
877
- if not isinstance(point_clouds, tuple):
878
- for col in range(terrain_raster.shape[1]):
879
- for row in range(terrain_raster.shape[0]):
880
- # get corresponding point cloud
881
- # one tile in point cloud correspond
882
- # to one tile in raster
883
- # uses rasterio conventions
884
- (
885
- pc_row,
886
- pc_col,
887
- ) = format_transformation.get_corresponding_indexes(
888
- row, col
877
+ # Add attributrs
878
+ terrain_raster.attributes["paths"] = paths_data
879
+
880
+ # Add final function to apply
881
+ terrain_raster.final_function = raster_final_function
882
+ ind_tile = 0
883
+ for point_cloud in point_clouds[0]:
884
+ for row_pc in range(point_cloud.shape[0]):
885
+ for col_pc in range(point_cloud.shape[1]):
886
+ # update saving infos for potential replacement
887
+ full_saving_info = ocht.update_saving_infos(
888
+ saving_info, row=0, col=ind_tile
889
889
  )
890
-
891
- if point_clouds.tiles[pc_row][pc_col] is not None:
892
- # Get window
893
- window = cars_dataset.window_array_to_dict(
894
- terrain_raster.tiling_grid[row, col]
895
- )
896
- # update saving infos for potential replacement
897
- full_saving_info = ocht.update_saving_infos(
898
- saving_info, row=row, col=col
899
- )
900
-
901
- # Get terrain region
902
- # corresponding to point cloud tile
903
- terrain_region = [
904
- point_clouds.tiling_grid[pc_row, pc_col, 0],
905
- point_clouds.tiling_grid[pc_row, pc_col, 2],
906
- point_clouds.tiling_grid[pc_row, pc_col, 1],
907
- point_clouds.tiling_grid[pc_row, pc_col, 3],
908
- ]
909
-
890
+ if point_cloud[row_pc, col_pc] is not None:
910
891
  # Delayed call to rasterization operations using all
911
892
  # required point clouds
912
893
  terrain_raster[
913
- row, col
894
+ 0, ind_tile
914
895
  ] = self.orchestrator.cluster.create_task(
915
896
  rasterization_wrapper
916
897
  )(
917
- point_clouds[pc_row, pc_col],
898
+ point_cloud[row_pc, col_pc],
918
899
  resolution,
919
900
  epsg,
920
901
  raster_profile,
921
- window=window,
922
- terrain_region=terrain_region,
902
+ window=None,
903
+ terrain_region=None,
904
+ terrain_full_roi=bounds,
923
905
  list_computed_layers=list_computed_layers,
924
906
  saving_info=full_saving_info,
925
907
  radius=self.dsm_radius,
@@ -931,50 +913,14 @@ class SimpleGaussian(
931
913
  source_pc_names=source_pc_names,
932
914
  performance_map_classes=performance_map_classes,
933
915
  )
934
- else:
935
- # Add final function to apply
936
- terrain_raster.final_function = raster_final_function
937
- ind_tile = 0
938
- for point_cloud in point_clouds[0]:
939
- for row_pc in range(point_cloud.shape[0]):
940
- for col_pc in range(point_cloud.shape[1]):
941
- # update saving infos for potential replacement
942
- full_saving_info = ocht.update_saving_infos(
943
- saving_info, row=0, col=ind_tile
944
- )
945
- if point_cloud[row_pc, col_pc] is not None:
946
- # Delayed call to rasterization operations using all
947
- # required point clouds
948
- terrain_raster[
949
- 0, ind_tile
950
- ] = self.orchestrator.cluster.create_task(
951
- rasterization_wrapper
952
- )(
953
- point_cloud[row_pc, col_pc],
954
- resolution,
955
- epsg,
956
- raster_profile,
957
- window=None,
958
- terrain_region=None,
959
- terrain_full_roi=bounds,
960
- list_computed_layers=list_computed_layers,
961
- saving_info=full_saving_info,
962
- radius=self.dsm_radius,
963
- sigma=self.sigma,
964
- dsm_no_data=self.dsm_no_data,
965
- texture_no_data=self.texture_no_data,
966
- color_dtype=color_dtype,
967
- msk_no_data=self.msk_no_data,
968
- source_pc_names=source_pc_names,
969
- performance_map_classes=performance_map_classes,
970
- )
971
- ind_tile += 1
916
+ ind_tile += 1
972
917
 
973
918
  # Sort tiles according to rank TODO remove or implement it ?
974
919
 
975
920
  return terrain_raster
976
921
 
977
922
 
923
+ # pylint: disable=too-many-positional-arguments
978
924
  def rasterization_wrapper( # noqa: C901
979
925
  cloud,
980
926
  resolution,
@@ -1044,8 +990,8 @@ def rasterization_wrapper( # noqa: C901
1044
990
  # If the point cloud is not in the right epsg referential, it is converted
1045
991
  if isinstance(cloud, xarray.Dataset):
1046
992
  # Transform Dataset to Dataframe
1047
- cloud, cloud_epsg = pc_fusion_algo.create_combined_cloud(
1048
- [cloud], [attributes["cloud_id"]], epsg
993
+ cloud, cloud_epsg = pc_transform.depth_map_dataset_to_dataframe(
994
+ cloud, epsg
1049
995
  )
1050
996
  elif cloud is None:
1051
997
  logging.warning("Input cloud is None")
@@ -1158,6 +1104,7 @@ def rasterization_wrapper( # noqa: C901
1158
1104
  list_computed_layers=list_computed_layers,
1159
1105
  source_pc_names=source_pc_names,
1160
1106
  performance_map_classes=performance_map_classes,
1107
+ cloud_global_id=attributes["cloud_id"],
1161
1108
  )
1162
1109
 
1163
1110
  # Fill raster
@@ -95,7 +95,7 @@ class Resampling(ApplicationTemplate, metaclass=ABCMeta):
95
95
  super().__init__(conf=conf)
96
96
 
97
97
  @abstractmethod
98
- def run(
98
+ def run( # pylint: disable=too-many-positional-arguments
99
99
  self,
100
100
  sensor_image_left,
101
101
  sensor_image_right,
@@ -208,7 +208,7 @@ class BicubicResampling(Resampling, short_name="bicubic"):
208
208
  largest_epipolar_region,
209
209
  )
210
210
 
211
- def run( # noqa: C901
211
+ def run( # pylint: disable=too-many-positional-arguments # noqa: C901
212
212
  self,
213
213
  sensor_image_left,
214
214
  sensor_image_right,
@@ -621,9 +621,11 @@ class BicubicResampling(Resampling, short_name="bicubic"):
621
621
  epipolar_images_left[row, col] = None
622
622
  if not in_sensor_right_array[row, col]:
623
623
  epipolar_images_right[row, col] = None
624
+
624
625
  return epipolar_images_left, epipolar_images_right
625
626
 
626
627
 
628
+ # pylint: disable=too-many-positional-arguments
627
629
  def generate_epipolar_images_wrapper(
628
630
  left_overlaps,
629
631
  right_overlaps,
@@ -41,7 +41,7 @@ from cars.core import datasets, inputs, tiling
41
41
  from cars.core.geometry import abstract_geometry
42
42
 
43
43
 
44
- def epipolar_rectify_images(
44
+ def epipolar_rectify_images( # pylint: disable=too-many-positional-arguments
45
45
  left_imgs,
46
46
  right_imgs,
47
47
  grid1,
@@ -108,7 +108,9 @@ def epipolar_rectify_images(
108
108
  right_margins[3] = right_region[3] - right_roi[3]
109
109
 
110
110
  # Resample left images
111
- left_img_transform = inputs.rasterio_get_transform(next(iter(left_imgs)))
111
+ left_img_transform = inputs.rasterio_get_transform(
112
+ next(iter(left_imgs)), convention="north"
113
+ )
112
114
 
113
115
  left_dataset = resample_image(
114
116
  left_imgs,
@@ -201,6 +203,7 @@ def epipolar_rectify_images(
201
203
  )
202
204
 
203
205
 
206
+ # pylint: disable=too-many-positional-arguments
204
207
  def resample_image( # noqa: C901
205
208
  imgs,
206
209
  grid,
@@ -252,7 +255,9 @@ def resample_image( # noqa: C901
252
255
  ]
253
256
 
254
257
  if img_transform is None:
255
- img_transform = inputs.rasterio_get_transform(img_sample)
258
+ img_transform = inputs.rasterio_get_transform(
259
+ img_sample, convention="north"
260
+ )
256
261
 
257
262
  # Convert largest_size to int if needed
258
263
  largest_size = [int(x) for x in largest_size]
@@ -344,7 +349,7 @@ def resample_image( # noqa: C901
344
349
  return dataset
345
350
 
346
351
 
347
- def oversampling_func(
352
+ def oversampling_func( # pylint: disable=too-many-positional-arguments
348
353
  grid_reader,
349
354
  img_reader,
350
355
  img_transform,
@@ -453,7 +458,10 @@ def oversampling_func(
453
458
  if in_sensor:
454
459
  # Get sensor data
455
460
  img_as_array = img_reader.read(bands["band_id"], window=img_window)
461
+ # get the nodata mask before blurring
462
+ img_nan_mask = img_as_array == nodata
456
463
 
464
+ # blur the image to avoid moiré artefacts if downsampling
457
465
  if resolution != 1:
458
466
  fourier = fftshift(fft2(img_as_array))
459
467
 
@@ -468,6 +476,10 @@ def oversampling_func(
468
476
 
469
477
  img_as_array = np.real(ifft2(ifftshift(f_filtered)))
470
478
 
479
+ # set the nodata values back
480
+ if nodata is not None:
481
+ img_as_array[img_nan_mask] = nodata
482
+
471
483
  # shift grid regarding the img extraction
472
484
  grid_as_array[0, ...] -= x_offset
473
485
  grid_as_array[1, ...] -= y_offset
@@ -34,9 +34,11 @@ import numpy as np
34
34
  # CARS imports
35
35
  from cars.core import constants as cst
36
36
  from cars.core import inputs
37
+ from cars.orchestrator.cluster.log_wrapper import cars_profile
37
38
  from cars.pipelines.parameters import sensor_inputs_constants as sens_cst
38
39
 
39
40
 
41
+ @cars_profile(name="Get paths and bands", interval=0.5)
40
42
  def get_paths_and_bands(sensor_image, required_bands=None):
41
43
  """
42
44
  Reformat file paths and bands required from each file to ease reading
@@ -92,7 +94,7 @@ def get_sensors_bounds(sensor_image_left, sensor_image_right):
92
94
  return left_sensor_bounds, right_sensor_bounds
93
95
 
94
96
 
95
- def check_tiles_in_sensor(
97
+ def check_tiles_in_sensor( # pylint: disable=too-many-positional-arguments
96
98
  sensor_image_left,
97
99
  sensor_image_right,
98
100
  image_tiling,
@@ -269,7 +269,7 @@ class SparseMatching(ApplicationTemplate, metaclass=ABCMeta):
269
269
 
270
270
  return margins_wrapper
271
271
 
272
- def filter_matches(
272
+ def filter_matches( # pylint: disable=too-many-positional-arguments
273
273
  self,
274
274
  epipolar_matches_left,
275
275
  grid_left,
@@ -159,7 +159,7 @@ class Sift(SparseMatching, short_name=["sift"]):
159
159
 
160
160
  # minimum number of matches to continue with
161
161
  overloaded_conf["minimum_nb_matches"] = conf.get(
162
- "minimum_nb_matches", 100
162
+ "minimum_nb_matches", 90
163
163
  )
164
164
 
165
165
  # sifts params
@@ -430,7 +430,7 @@ class Sift(SparseMatching, short_name=["sift"]):
430
430
  """
431
431
  self.decimation_factor = value
432
432
 
433
- def run(
433
+ def run( # pylint: disable=too-many-positional-arguments
434
434
  self,
435
435
  epipolar_image_left,
436
436
  epipolar_image_right,
@@ -627,7 +627,7 @@ class Sift(SparseMatching, short_name=["sift"]):
627
627
  return epipolar_disparity_map_left, None
628
628
 
629
629
 
630
- def compute_matches_wrapper(
630
+ def compute_matches_wrapper( # pylint: disable=too-many-positional-arguments
631
631
  left_image_object: xr.Dataset,
632
632
  right_image_object: xr.Dataset,
633
633
  used_band="b0",
@@ -37,7 +37,7 @@ from cars.applications.sparse_matching.sparse_matching_wrappers import (
37
37
  )
38
38
 
39
39
 
40
- def compute_matches(
40
+ def compute_matches( # pylint: disable=too-many-positional-arguments
41
41
  left: np.ndarray,
42
42
  right: np.ndarray,
43
43
  left_mask: np.ndarray = None,
@@ -191,6 +191,7 @@ def compute_matches(
191
191
  right_id_offset = left_id
192
192
  else:
193
193
  right_descr_block = []
194
+ right_id_offset = 0
194
195
  else:
195
196
  right_descr_block = right_descr
196
197
  right_id_offset = 0
@@ -253,7 +254,7 @@ def compute_matches(
253
254
  return matches
254
255
 
255
256
 
256
- def dataset_matching(
257
+ def dataset_matching( # pylint: disable=too-many-positional-arguments
257
258
  ds1,
258
259
  ds2,
259
260
  used_band,
@@ -170,7 +170,7 @@ def compute_disp_min_disp_max(
170
170
  return dmin, dmax
171
171
 
172
172
 
173
- @cars_profile(name="filter_point_cloud_matches")
173
+ @cars_profile(name="Filter_point_cloud_matches")
174
174
  def filter_point_cloud_matches(
175
175
  pd_cloud,
176
176
  match_filter_knn=25,
@@ -94,7 +94,7 @@ class Triangulation(ApplicationTemplate, metaclass=ABCMeta):
94
94
  super().__init__(conf=conf)
95
95
 
96
96
  @abstractmethod
97
- def run( # noqa: C901
97
+ def run( # pylint: disable=too-many-positional-arguments # noqa: C901
98
98
  self,
99
99
  sensor_image_left,
100
100
  sensor_image_right,
@@ -39,11 +39,8 @@ from shareloc.geofunctions.rectification_grid import RectificationGrid
39
39
  import cars.orchestrator.orchestrator as ocht
40
40
  from cars.applications import application_constants
41
41
  from cars.applications.grid_generation import grid_generation_algo
42
- from cars.applications.point_cloud_fusion import (
43
- pc_fusion_algo,
44
- pc_fusion_wrappers,
45
- )
46
42
  from cars.applications.triangulation import (
43
+ pc_transform,
47
44
  triangulation_algo,
48
45
  triangulation_constants,
49
46
  )
@@ -58,6 +55,7 @@ from cars.core import constants as cst
58
55
  from cars.core import inputs, projection, tiling
59
56
  from cars.core.utils import safe_makedirs
60
57
  from cars.data_structures import cars_dataset
58
+ from cars.orchestrator.cluster.log_wrapper import cars_profile
61
59
  from cars.pipelines.parameters import sensor_inputs_constants as sens_cst
62
60
 
63
61
 
@@ -133,6 +131,8 @@ class LineOfSightIntersection(
133
131
 
134
132
  return overloaded_conf
135
133
 
134
+ # pylint: disable=too-many-positional-arguments
135
+ @cars_profile(name="Save triangulation output", interval=0.5)
136
136
  def save_triangulation_output( # noqa: C901 function is too complex
137
137
  self,
138
138
  epipolar_point_cloud,
@@ -355,7 +355,8 @@ class LineOfSightIntersection(
355
355
  optional_data=True,
356
356
  )
357
357
 
358
- def fill_index(
358
+ @cars_profile(name="Fill index", interval=0.5)
359
+ def fill_index( # pylint: disable=too-many-positional-arguments
359
360
  self,
360
361
  save_output_coordinates=True,
361
362
  save_output_color=True,
@@ -466,7 +467,7 @@ class LineOfSightIntersection(
466
467
 
467
468
  return csv_pc_dir_name, laz_pc_dir_name
468
469
 
469
- def run( # noqa: C901
470
+ def run( # pylint: disable=too-many-positional-arguments # noqa: C901
470
471
  self,
471
472
  sensor_image_left,
472
473
  sensor_image_right,
@@ -933,7 +934,7 @@ class LineOfSightIntersection(
933
934
  return epipolar_point_cloud
934
935
 
935
936
 
936
- def triangulation_wrapper(
937
+ def triangulation_wrapper( # pylint: disable=too-many-positional-arguments
937
938
  disparity_object: xr.Dataset,
938
939
  sensor1,
939
940
  sensor2,
@@ -1154,10 +1155,10 @@ def triangulation_wrapper(
1154
1155
  flatten_pc_dataset = None
1155
1156
  if point_cloud_csv_file_name or point_cloud_laz_file_name:
1156
1157
  # Convert epipolar array into point cloud
1157
- flatten_pc_dataset, cloud_epsg = pc_fusion_algo.create_combined_cloud(
1158
- [pc_dataset], [0], epsg
1158
+ flatten_pc_dataset, cloud_epsg = (
1159
+ pc_transform.depth_map_dataset_to_dataframe(pc_dataset, epsg)
1159
1160
  )
1160
- # Convert to UTM
1161
+ # Convert to wanted epsg
1161
1162
  if epsg is not None and cloud_epsg != epsg:
1162
1163
  projection.point_cloud_conversion_dataframe(
1163
1164
  flatten_pc_dataset, cloud_epsg, epsg
@@ -1165,7 +1166,7 @@ def triangulation_wrapper(
1165
1166
  cloud_epsg = epsg
1166
1167
 
1167
1168
  # Fill attributes for LAZ saving
1168
- color_type = pc_fusion_wrappers.get_color_type([pc_dataset])
1169
+ color_type = pc_transform.get_color_type([pc_dataset])
1169
1170
  attributes = {
1170
1171
  "epsg": cloud_epsg,
1171
1172
  "color_type": color_type,
@@ -1196,6 +1197,7 @@ def triangulation_wrapper(
1196
1197
  return pc_dataset, flatten_pc_dataset
1197
1198
 
1198
1199
 
1200
+ # pylint: disable=too-many-positional-arguments
1199
1201
  def triangulation_wrapper_matches(
1200
1202
  matches,
1201
1203
  sensor1,