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
@@ -160,6 +160,7 @@ class PointCloudOutlierRemoval(ScalingApplicationTemplate, metaclass=ABCMeta):
160
160
 
161
161
  """
162
162
 
163
+ # pylint: disable=too-many-positional-arguments
163
164
  def __register_epipolar_dataset__(
164
165
  self,
165
166
  epipolar_point_cloud,
@@ -350,7 +351,7 @@ class PointCloudOutlierRemoval(ScalingApplicationTemplate, metaclass=ABCMeta):
350
351
  )
351
352
 
352
353
  @abstractmethod
353
- def run(
354
+ def run( # pylint: disable=too-many-positional-arguments
354
355
  self,
355
356
  merged_point_cloud,
356
357
  orchestrator=None,
@@ -31,7 +31,7 @@ import outlier_filter # pylint:disable=E0401
31
31
  import pandas
32
32
  from scipy.spatial import cKDTree # pylint: disable=no-name-in-module
33
33
 
34
- from cars.applications.point_cloud_fusion.pc_fusion_wrappers import filter_cloud
34
+ from cars.applications.triangulation import pc_transform
35
35
 
36
36
  # CARS imports
37
37
  from cars.core import constants as cst
@@ -82,7 +82,9 @@ def small_component_filtering(
82
82
  clusters_distance_threshold=clusters_distance_threshold_float,
83
83
  )
84
84
 
85
- return filter_cloud(cloud, index_elt_to_remove, filtered_elt_pos)
85
+ return pc_transform.filter_cloud(
86
+ cloud, index_elt_to_remove, filtered_elt_pos
87
+ )
86
88
 
87
89
 
88
90
  def detect_small_components(
@@ -188,6 +190,7 @@ def detect_small_components(
188
190
  # ##### statistical filtering ######
189
191
 
190
192
 
193
+ # pylint: disable=too-many-positional-arguments
191
194
  def statistical_outlier_filtering(
192
195
  cloud: pandas.DataFrame,
193
196
  k: int,
@@ -228,7 +231,9 @@ def statistical_outlier_filtering(
228
231
  use_median=use_median,
229
232
  )
230
233
 
231
- return filter_cloud(cloud, index_elt_to_remove, filtered_elt_pos)
234
+ return pc_transform.filter_cloud(
235
+ cloud, index_elt_to_remove, filtered_elt_pos
236
+ )
232
237
 
233
238
 
234
239
  def detect_statistical_outliers(
@@ -339,9 +344,9 @@ def epipolar_small_components(
339
344
  return cloud
340
345
 
341
346
 
347
+ # pylint: disable=too-many-positional-arguments
342
348
  def epipolar_statistical_filtering(
343
349
  epipolar_ds,
344
- epsg,
345
350
  k=15,
346
351
  filtering_constant=0.0,
347
352
  mean_factor=1.0,
@@ -354,8 +359,6 @@ def epipolar_statistical_filtering(
354
359
 
355
360
  :param epipolar_ds: epipolar dataset to filter
356
361
  :type epipolar_ds: xr.Dataset
357
- :param epsg: epsg code of the CRS used to compute distances
358
- :type epsg: int
359
362
  :param statistical_k: k
360
363
  :type statistical_k: int
361
364
  :param std_dev_factor: std factor
@@ -370,8 +373,6 @@ def epipolar_statistical_filtering(
370
373
 
371
374
  """
372
375
 
373
- projection.point_cloud_conversion_dataset(epipolar_ds, epsg)
374
-
375
376
  if not np.all(np.isnan(epipolar_ds[cst.Z])):
376
377
 
377
378
  outlier_filter.epipolar_statistical_outlier_filtering(
@@ -27,9 +27,7 @@ import copy
27
27
 
28
28
  # Standard imports
29
29
  import logging
30
- import math
31
30
  import os
32
- import time
33
31
 
34
32
  # Third party imports
35
33
  import numpy as np
@@ -39,14 +37,13 @@ from pyproj import CRS
39
37
  # CARS imports
40
38
  import cars.orchestrator.orchestrator as ocht
41
39
  from cars.applications import application_constants
42
- from cars.applications.point_cloud_fusion import (
43
- pc_fusion_algo,
44
- pc_fusion_wrappers,
45
- )
46
40
  from cars.applications.point_cloud_outlier_removal import (
47
41
  abstract_outlier_removal_app as pc_removal,
48
42
  )
49
- from cars.applications.point_cloud_outlier_removal import outlier_removal_algo
43
+ from cars.applications.point_cloud_outlier_removal import (
44
+ outlier_removal_algo,
45
+ )
46
+ from cars.applications.triangulation import pc_transform
50
47
  from cars.applications.triangulation.triangulation_wrappers import (
51
48
  generate_point_cloud_file_names,
52
49
  )
@@ -79,7 +76,6 @@ class SmallComponents(
79
76
  self.used_method = self.used_config["method"]
80
77
 
81
78
  # small components
82
- self.activated = self.used_config["activated"]
83
79
  self.on_ground_margin = self.used_config["on_ground_margin"]
84
80
  self.connection_distance = self.used_config["connection_distance"]
85
81
  self.nb_points_threshold = self.used_config["nb_points_threshold"]
@@ -121,10 +117,6 @@ class SmallComponents(
121
117
  overloaded_conf["save_by_pair"] = conf.get("save_by_pair", False)
122
118
 
123
119
  # small components
124
- overloaded_conf["activated"] = conf.get(
125
- "activated", True
126
- ) # if false, the following
127
- # parameters are unused
128
120
  # on_ground_margin:
129
121
  # margin added to the on ground region to not filter
130
122
  # points clusters
@@ -161,7 +153,6 @@ class SmallComponents(
161
153
  point_cloud_fusion_schema = {
162
154
  "method": str,
163
155
  "save_by_pair": bool,
164
- "activated": bool,
165
156
  "on_ground_margin": int,
166
157
  "connection_distance": And(float, lambda x: x > 0),
167
158
  "nb_points_threshold": And(int, lambda x: x > 0),
@@ -196,18 +187,12 @@ class SmallComponents(
196
187
  :rtype: float
197
188
 
198
189
  """
190
+ tot = 10000 * superposing_point_clouds / point_cloud_resolution
199
191
 
200
- if not self.activated:
201
- # if not activated, this tile size must not be taken into acount
202
- # during the min(*tile_sizes) operations
203
- tile_size = math.inf
204
- else:
205
- tot = 10000 * superposing_point_clouds / point_cloud_resolution
206
-
207
- import_ = 200 # MiB
208
- tile_size = int(
209
- np.sqrt(float(((max_ram_per_worker - import_) * 2**23)) / tot)
210
- )
192
+ import_ = 200 # MiB
193
+ tile_size = int(
194
+ np.sqrt(float(((max_ram_per_worker - import_) * 2**23)) / tot)
195
+ )
211
196
 
212
197
  logging.info(
213
198
  "Estimated optimal tile size for small"
@@ -234,11 +219,7 @@ class SmallComponents(
234
219
  :return: margin
235
220
  :rtype: int
236
221
  """
237
-
238
- margin = 0
239
-
240
- if self.activated:
241
- margin = self.half_epipolar_size
222
+ margin = self.half_epipolar_size
242
223
 
243
224
  return margin
244
225
 
@@ -250,15 +231,11 @@ class SmallComponents(
250
231
  :rtype: float
251
232
 
252
233
  """
253
-
254
- on_ground_margin = 0
255
-
256
- if self.activated:
257
- on_ground_margin = self.on_ground_margin * resolution
234
+ on_ground_margin = self.on_ground_margin * resolution
258
235
 
259
236
  return on_ground_margin
260
237
 
261
- def run(
238
+ def run( # pylint: disable=too-many-positional-arguments
262
239
  self,
263
240
  merged_point_cloud,
264
241
  orchestrator=None,
@@ -312,10 +289,6 @@ class SmallComponents(
312
289
 
313
290
  :rtype: CarsDataset filled with xr.Dataset
314
291
  """
315
-
316
- if not self.activated:
317
- return merged_point_cloud
318
-
319
292
  # Default orchestrator
320
293
  if orchestrator is None:
321
294
  # Create default sequential orchestrator for current application
@@ -327,244 +300,99 @@ class SmallComponents(
327
300
  else:
328
301
  self.orchestrator = orchestrator
329
302
 
330
- if merged_point_cloud.dataset_type == "points":
331
- (
332
- filtered_point_cloud,
333
- point_cloud_laz_file_name,
334
- point_cloud_csv_file_name,
335
- saving_info,
336
- ) = self.__register_pc_dataset__(
337
- merged_point_cloud,
338
- point_cloud_dir,
339
- dump_dir,
340
- app_name="small_components",
341
- )
342
- # Generate rasters
343
- for col in range(filtered_point_cloud.shape[1]):
344
- for row in range(filtered_point_cloud.shape[0]):
345
- # update saving infos for potential replacement
346
- full_saving_info = ocht.update_saving_infos(
347
- saving_info, row=row, col=col
348
- )
349
- if merged_point_cloud.tiles[row][col] is not None:
350
- # Delayed call to cloud filtering
351
- filtered_point_cloud[
352
- row, col
353
- ] = self.orchestrator.cluster.create_task(
354
- small_component_removal_wrapper
355
- )(
356
- merged_point_cloud[row, col],
357
- self.connection_distance,
358
- self.nb_points_threshold,
359
- self.clusters_distance_threshold,
360
- save_by_pair=(self.save_by_pair),
361
- point_cloud_csv_file_name=point_cloud_csv_file_name,
362
- point_cloud_laz_file_name=point_cloud_laz_file_name,
363
- saving_info=full_saving_info,
364
- )
303
+ if dump_dir is None:
304
+ dump_dir = self.generate_unknown_dump_dir(self.orchestrator)
365
305
 
366
- elif merged_point_cloud.dataset_type == "arrays":
367
- prefix = os.path.basename(dump_dir)
368
- # Save as depth map
369
- filtered_point_cloud, saving_info_epipolar = (
370
- self.__register_epipolar_dataset__(
371
- merged_point_cloud,
372
- depth_map_dir,
373
- dump_dir,
374
- app_name="small_components",
375
- pair_key=prefix,
376
- )
306
+ if merged_point_cloud.dataset_type != "arrays":
307
+ raise RuntimeError(
308
+ "Only arrays is supported in small components removal"
377
309
  )
378
-
379
- # Save as point cloud
380
- (
381
- flatten_filtered_point_cloud,
382
- laz_pc_dir_name,
383
- csv_pc_dir_name,
384
- saving_info_flatten,
385
- ) = self.__register_pc_dataset__(
310
+ prefix = os.path.basename(dump_dir)
311
+ # Save as depth map
312
+ filtered_point_cloud, saving_info_epipolar = (
313
+ self.__register_epipolar_dataset__(
386
314
  merged_point_cloud,
387
- point_cloud_dir,
315
+ depth_map_dir,
388
316
  dump_dir,
389
317
  app_name="small_components",
318
+ pair_key=prefix,
390
319
  )
320
+ )
391
321
 
392
- # initialize empty index file for point cloud product if official
393
- # product is requested
394
- pc_index = None
395
- if point_cloud_dir:
396
- pc_index = {}
322
+ # Save as point cloud
323
+ (
324
+ flatten_filtered_point_cloud,
325
+ laz_pc_dir_name,
326
+ csv_pc_dir_name,
327
+ saving_info_flatten,
328
+ ) = self.__register_pc_dataset__(
329
+ merged_point_cloud,
330
+ point_cloud_dir,
331
+ dump_dir,
332
+ app_name="small_components",
333
+ )
334
+
335
+ # initialize empty index file for point cloud product if official
336
+ # product is requested
337
+ pc_index = None
338
+ if point_cloud_dir:
339
+ pc_index = {}
397
340
 
398
- # Generate rasters
399
- for col in range(filtered_point_cloud.shape[1]):
400
- for row in range(filtered_point_cloud.shape[0]):
341
+ # Generate rasters
342
+ for col in range(filtered_point_cloud.shape[1]):
343
+ for row in range(filtered_point_cloud.shape[0]):
401
344
 
402
- # update saving infos for potential replacement
403
- full_saving_info_epipolar = ocht.update_saving_infos(
404
- saving_info_epipolar, row=row, col=col
345
+ # update saving infos for potential replacement
346
+ full_saving_info_epipolar = ocht.update_saving_infos(
347
+ saving_info_epipolar, row=row, col=col
348
+ )
349
+ full_saving_info_flatten = None
350
+ if saving_info_flatten is not None:
351
+ full_saving_info_flatten = ocht.update_saving_infos(
352
+ saving_info_flatten, row=row, col=col
405
353
  )
406
- full_saving_info_flatten = None
407
- if saving_info_flatten is not None:
408
- full_saving_info_flatten = ocht.update_saving_infos(
409
- saving_info_flatten, row=row, col=col
354
+ if merged_point_cloud[row][col] is not None:
355
+ csv_pc_file_name, laz_pc_file_name = (
356
+ generate_point_cloud_file_names(
357
+ csv_pc_dir_name,
358
+ laz_pc_dir_name,
359
+ row,
360
+ col,
361
+ pc_index,
362
+ pair_key=prefix,
410
363
  )
411
- if merged_point_cloud[row][col] is not None:
412
- csv_pc_file_name, laz_pc_file_name = (
413
- generate_point_cloud_file_names(
414
- csv_pc_dir_name,
415
- laz_pc_dir_name,
416
- row,
417
- col,
418
- pc_index,
419
- pair_key=prefix,
420
- )
421
- )
422
- window = merged_point_cloud.tiling_grid[row, col]
423
- overlap = filtered_point_cloud.overlaps[row, col]
424
- # Delayed call to cloud filtering
425
- (
426
- filtered_point_cloud[row, col],
427
- flatten_filtered_point_cloud[row, col],
428
- ) = self.orchestrator.cluster.create_task(
429
- epipolar_small_component_removal_wrapper, nout=2
430
- )(
431
- merged_point_cloud[row, col],
432
- self.connection_distance,
433
- self.nb_points_threshold,
434
- self.clusters_distance_threshold,
435
- self.half_epipolar_size,
436
- window,
437
- overlap,
438
- point_cloud_csv_file_name=csv_pc_file_name,
439
- point_cloud_laz_file_name=laz_pc_file_name,
440
- saving_info_epipolar=full_saving_info_epipolar,
441
- saving_info_flatten=full_saving_info_flatten,
442
- )
443
-
444
- # update point cloud index
445
- if point_cloud_dir:
446
- self.orchestrator.update_index(pc_index)
364
+ )
365
+ window = merged_point_cloud.tiling_grid[row, col]
366
+ overlap = filtered_point_cloud.overlaps[row, col]
367
+ # Delayed call to cloud filtering
368
+ (
369
+ filtered_point_cloud[row, col],
370
+ flatten_filtered_point_cloud[row, col],
371
+ ) = self.orchestrator.cluster.create_task(
372
+ epipolar_small_component_removal_wrapper, nout=2
373
+ )(
374
+ merged_point_cloud[row, col],
375
+ self.connection_distance,
376
+ self.nb_points_threshold,
377
+ self.clusters_distance_threshold,
378
+ self.half_epipolar_size,
379
+ window,
380
+ overlap,
381
+ epsg=epsg,
382
+ point_cloud_csv_file_name=csv_pc_file_name,
383
+ point_cloud_laz_file_name=laz_pc_file_name,
384
+ saving_info_epipolar=full_saving_info_epipolar,
385
+ saving_info_flatten=full_saving_info_flatten,
386
+ )
447
387
 
448
- else:
449
- logging.error(
450
- "PointCloudOutlierRemoval application doesn't support "
451
- "this input data "
452
- "format"
453
- )
388
+ # update point cloud index
389
+ if point_cloud_dir:
390
+ self.orchestrator.update_index(pc_index)
454
391
 
455
392
  return filtered_point_cloud
456
393
 
457
394
 
458
- def small_component_removal_wrapper(
459
- cloud,
460
- connection_distance,
461
- nb_points_threshold,
462
- clusters_distance_threshold,
463
- save_by_pair: bool = False,
464
- point_cloud_csv_file_name=None,
465
- point_cloud_laz_file_name=None,
466
- saving_info=None,
467
- ):
468
- """
469
- Small components outlier removal
470
-
471
- :param cloud: cloud to filter
472
- :type cloud: pandas DataFrame
473
- :param connection_distance: connection distance
474
- :type connection_distance: float
475
- :param nb_points_threshold:
476
- :type nb_points_threshold: int
477
- :param clusters_distance_threshold:
478
- :type clusters_distance_threshold: float
479
- :param save_by_pair: save point cloud as pair
480
- :type save_by_pair: bool
481
- :param point_cloud_csv_file_name: write point cloud as CSV in filename
482
- (if None, the point cloud is not written as csv)
483
- :type point_cloud_csv_file_name: str
484
- :param point_cloud_laz_file_name: write point cloud as laz in filename
485
- (if None, the point cloud is not written as laz)
486
- :type point_cloud_laz_file_name: str
487
- :param saving_info: saving infos
488
- :type saving_info: dict
489
-
490
- :return: filtered cloud
491
- :rtype: pandas DataFrame
492
-
493
- """
494
-
495
- # Copy input cloud
496
- new_cloud = cloud.copy()
497
- new_cloud.attrs = copy.deepcopy(cloud.attrs)
498
-
499
- # Get current epsg
500
- cloud_attributes = cars_dataset.get_attributes(new_cloud)
501
- cloud_epsg = cloud_attributes["epsg"]
502
- current_epsg = cloud_epsg
503
-
504
- # Check if can be used to filter
505
- spatial_ref = CRS.from_epsg(cloud_epsg)
506
- if spatial_ref.is_geographic:
507
- logging.debug(
508
- "The points cloud to filter is not in a cartographic system. "
509
- "The filter's default parameters might not be adapted "
510
- "to this referential. Please, convert the points "
511
- "cloud to ECEF to ensure a proper point_cloud."
512
- )
513
- # Convert to epsg = 4978
514
- cartographic_epsg = 4978
515
-
516
- projection.point_cloud_conversion_dataframe(
517
- new_cloud, current_epsg, cartographic_epsg
518
- )
519
- current_epsg = cartographic_epsg
520
-
521
- # Filter point cloud
522
- tic = time.process_time()
523
- (
524
- new_cloud,
525
- _,
526
- ) = outlier_removal_algo.small_component_filtering(
527
- new_cloud,
528
- connection_distance,
529
- nb_points_threshold,
530
- clusters_distance_threshold,
531
- )
532
- toc = time.process_time()
533
- logging.debug(
534
- "Small component cloud filtering done in {} seconds".format(toc - tic)
535
- )
536
-
537
- # Conversion to UTM
538
- projection.point_cloud_conversion_dataframe(
539
- new_cloud, cloud_epsg, current_epsg
540
- )
541
- # Update attributes
542
- cloud_attributes["epsg"] = current_epsg
543
- cars_dataset.fill_dataframe(
544
- new_cloud, saving_info=saving_info, attributes=cloud_attributes
545
- )
546
-
547
- # save point cloud in worker
548
- if point_cloud_csv_file_name:
549
- cars_dataset.run_save_points(
550
- new_cloud,
551
- point_cloud_csv_file_name,
552
- save_by_pair=save_by_pair,
553
- overwrite=True,
554
- point_cloud_format="csv",
555
- )
556
- if point_cloud_laz_file_name:
557
- cars_dataset.run_save_points(
558
- new_cloud,
559
- point_cloud_laz_file_name,
560
- save_by_pair=save_by_pair,
561
- overwrite=True,
562
- point_cloud_format="laz",
563
- )
564
-
565
- return new_cloud
566
-
567
-
395
+ # pylint: disable=too-many-positional-arguments
568
396
  def epipolar_small_component_removal_wrapper(
569
397
  cloud,
570
398
  connection_distance,
@@ -573,6 +401,7 @@ def epipolar_small_component_removal_wrapper(
573
401
  half_epipolar_size,
574
402
  window,
575
403
  overlap,
404
+ epsg=None,
576
405
  point_cloud_csv_file_name=None,
577
406
  point_cloud_laz_file_name=None,
578
407
  saving_info_epipolar=None,
@@ -649,19 +478,19 @@ def epipolar_small_component_removal_wrapper(
649
478
  if point_cloud_csv_file_name or point_cloud_laz_file_name:
650
479
  # Convert epipolar array into point cloud
651
480
  flatten_filtered_cloud, cloud_epsg = (
652
- pc_fusion_algo.create_combined_cloud(
653
- [filtered_cloud], ["0"], current_epsg
481
+ pc_transform.depth_map_dataset_to_dataframe(
482
+ filtered_cloud, current_epsg
654
483
  )
655
484
  )
656
485
  # Convert to UTM
657
- if current_epsg is not None and cloud_epsg != current_epsg:
486
+ if epsg is not None and cloud_epsg != epsg:
658
487
  projection.point_cloud_conversion_dataframe(
659
- flatten_filtered_cloud, cloud_epsg, current_epsg
488
+ flatten_filtered_cloud, cloud_epsg, epsg
660
489
  )
661
- cloud_epsg = current_epsg
490
+ cloud_epsg = epsg
662
491
 
663
492
  # Fill attributes for LAZ saving
664
- color_type = pc_fusion_wrappers.get_color_type([filtered_cloud])
493
+ color_type = pc_transform.get_color_type([filtered_cloud])
665
494
 
666
495
  attributes = {
667
496
  "epsg": cloud_epsg,