cars 0.12.0rc2__tar.gz → 1.0.0a1__tar.gz

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 (249) hide show
  1. cars-1.0.0a1/.gitlab-ci.yml +161 -0
  2. {cars-0.12.0rc2 → cars-1.0.0a1}/AUTHORS.md +1 -1
  3. {cars-0.12.0rc2 → cars-1.0.0a1}/PKG-INFO +2 -2
  4. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/auxiliary_filling/__init__.py +2 -2
  5. cars-0.12.0rc2/cars/applications/auxiliary_filling/auxiliary_filling_tools.py → cars-1.0.0a1/cars/applications/auxiliary_filling/auxiliary_filling_algo.py +129 -170
  6. cars-0.12.0rc2/cars/applications/auxiliary_filling/auxiliary_filling_from_sensors.py → cars-1.0.0a1/cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +34 -21
  7. cars-1.0.0a1/cars/applications/auxiliary_filling/auxiliary_filling_wrappers.py +89 -0
  8. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dem_generation/__init__.py +4 -2
  9. cars-1.0.0a1/cars/applications/dem_generation/dem_generation_algo.py +232 -0
  10. cars-1.0.0a1/cars/applications/dem_generation/dem_generation_wrappers.py +376 -0
  11. cars-0.12.0rc2/cars/applications/dem_generation/dichotomic_generation.py → cars-1.0.0a1/cars/applications/dem_generation/dichotomic_generation_app.py +10 -170
  12. cars-0.12.0rc2/cars/applications/dem_generation/rasterization.py → cars-1.0.0a1/cars/applications/dem_generation/rasterization_app.py +79 -353
  13. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/__init__.py +2 -2
  14. cars-0.12.0rc2/cars/applications/dense_match_filling/dense_match_filling.py → cars-1.0.0a1/cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +1 -1
  15. cars-0.12.0rc2/cars/applications/dense_match_filling/fill_disp_tools.py → cars-1.0.0a1/cars/applications/dense_match_filling/fill_disp_algo.py +29 -414
  16. cars-1.0.0a1/cars/applications/dense_match_filling/fill_disp_wrappers.py +426 -0
  17. cars-0.12.0rc2/cars/applications/dense_match_filling/plane.py → cars-1.0.0a1/cars/applications/dense_match_filling/plane_app.py +16 -13
  18. cars-0.12.0rc2/cars/applications/dense_match_filling/zero_padding.py → cars-1.0.0a1/cars/applications/dense_match_filling/zero_padding_app.py +9 -6
  19. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/__init__.py +4 -2
  20. cars-0.12.0rc2/cars/applications/dense_matching/dense_matching.py → cars-1.0.0a1/cars/applications/dense_matching/abstract_dense_matching_app.py +7 -3
  21. cars-0.12.0rc2/cars/applications/dense_matching/census_mccnn_sgm.py → cars-1.0.0a1/cars/applications/dense_matching/census_mccnn_sgm_app.py +170 -29
  22. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/cpp/dense_matching_cpp.py +11 -2
  23. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/cpp/includes/dense_matching.hpp +4 -2
  24. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/cpp/src/dense_matching.cpp +25 -8
  25. cars-1.0.0a1/cars/applications/dense_matching/dense_matching_algo.py +256 -0
  26. cars-0.12.0rc2/cars/applications/dense_matching/dense_matching_tools.py → cars-1.0.0a1/cars/applications/dense_matching/dense_matching_wrappers.py +130 -232
  27. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_census_sgm_sparse.json +2 -1
  28. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/pandora_loader.py +13 -11
  29. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dsm_filling/__init__.py +6 -2
  30. cars-0.12.0rc2/cars/applications/dsm_filling/border_interpolation.py → cars-1.0.0a1/cars/applications/dsm_filling/border_interpolation_app.py +1 -1
  31. cars-0.12.0rc2/cars/applications/dsm_filling/bulldozer_filling.py → cars-1.0.0a1/cars/applications/dsm_filling/bulldozer_filling_app.py +1 -1
  32. cars-0.12.0rc2/cars/applications/dsm_filling/exogenous_filling.py → cars-1.0.0a1/cars/applications/dsm_filling/exogenous_filling_app.py +1 -1
  33. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/grid_generation/__init__.py +4 -2
  34. cars-0.12.0rc2/cars/applications/grid_generation/epipolar_grid_generation.py → cars-1.0.0a1/cars/applications/grid_generation/epipolar_grid_generation_app.py +29 -46
  35. cars-0.12.0rc2/cars/applications/grid_generation/grid_correction.py → cars-1.0.0a1/cars/applications/grid_generation/grid_correction_app.py +52 -51
  36. cars-0.12.0rc2/cars/applications/grid_generation/grids.py → cars-1.0.0a1/cars/applications/grid_generation/grid_generation_algo.py +8 -13
  37. cars-0.12.0rc2/cars/applications/grid_generation/grid_constants.py → cars-1.0.0a1/cars/applications/grid_generation/grid_generation_constants.py +2 -1
  38. cars-1.0.0a1/cars/applications/grid_generation/transform_grid.py +88 -0
  39. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/ground_truth_reprojection/__init__.py +2 -2
  40. cars-0.12.0rc2/cars/applications/ground_truth_reprojection/ground_truth_reprojection.py → cars-1.0.0a1/cars/applications/ground_truth_reprojection/abstract_ground_truth_reprojection_app.py +1 -1
  41. cars-0.12.0rc2/cars/applications/ground_truth_reprojection/direct_localization.py → cars-1.0.0a1/cars/applications/ground_truth_reprojection/direct_localization_app.py +15 -12
  42. cars-0.12.0rc2/cars/applications/ground_truth_reprojection/ground_truth_reprojection_tools.py → cars-1.0.0a1/cars/applications/ground_truth_reprojection/ground_truth_reprojection_algo.py +2 -2
  43. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/hole_detection/__init__.py +4 -2
  44. cars-0.12.0rc2/cars/applications/hole_detection/cloud_to_bbox.py → cars-1.0.0a1/cars/applications/hole_detection/cloud_to_bbox_app.py +9 -7
  45. cars-0.12.0rc2/cars/applications/hole_detection/hole_detection_tools.py → cars-1.0.0a1/cars/applications/hole_detection/hole_detection_algo.py +4 -27
  46. cars-1.0.0a1/cars/applications/hole_detection/hole_detection_wrappers.py +53 -0
  47. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/point_cloud_denoising/__init__.py +2 -2
  48. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/point_cloud_fusion/__init__.py +2 -2
  49. cars-0.12.0rc2/cars/applications/point_cloud_fusion/point_cloud_fusion.py → cars-1.0.0a1/cars/applications/point_cloud_fusion/abstract_pc_fusion_app.py +1 -1
  50. cars-0.12.0rc2/cars/applications/point_cloud_fusion/mapping_to_terrain_tiles.py → cars-1.0.0a1/cars/applications/point_cloud_fusion/mapping_to_terrain_tiles_app.py +12 -12
  51. cars-0.12.0rc2/cars/applications/point_cloud_fusion/pc_tif_tools.py → cars-1.0.0a1/cars/applications/point_cloud_fusion/pc_fusion_algo.py +505 -426
  52. cars-1.0.0a1/cars/applications/point_cloud_fusion/pc_fusion_wrappers.py +870 -0
  53. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/point_cloud_outlier_removal/__init__.py +2 -2
  54. cars-0.12.0rc2/cars/applications/point_cloud_outlier_removal/pc_out_removal.py → cars-1.0.0a1/cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +1 -1
  55. cars-0.12.0rc2/cars/applications/point_cloud_outlier_removal/outlier_removal_tools.py → cars-1.0.0a1/cars/applications/point_cloud_outlier_removal/outlier_removal_algo.py +1 -6
  56. cars-0.12.0rc2/cars/applications/point_cloud_outlier_removal/small_components.py → cars-1.0.0a1/cars/applications/point_cloud_outlier_removal/small_components_app.py +37 -18
  57. cars-0.12.0rc2/cars/applications/point_cloud_outlier_removal/statistical.py → cars-1.0.0a1/cars/applications/point_cloud_outlier_removal/statistical_app.py +11 -10
  58. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/rasterization/__init__.py +2 -2
  59. cars-1.0.0a1/cars/applications/rasterization/rasterization_algo.py +529 -0
  60. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/rasterization/rasterization_constants.py +1 -1
  61. cars-0.12.0rc2/cars/applications/rasterization/rasterization_tools.py → cars-1.0.0a1/cars/applications/rasterization/rasterization_wrappers.py +4 -491
  62. cars-0.12.0rc2/cars/applications/rasterization/simple_gaussian.py → cars-1.0.0a1/cars/applications/rasterization/simple_gaussian_app.py +48 -31
  63. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/resampling/__init__.py +2 -2
  64. cars-0.12.0rc2/cars/applications/resampling/resampling.py → cars-1.0.0a1/cars/applications/resampling/abstract_resampling_app.py +12 -3
  65. cars-0.12.0rc2/cars/applications/resampling/bicubic_resampling.py → cars-1.0.0a1/cars/applications/resampling/bicubic_resampling_app.py +102 -382
  66. cars-1.0.0a1/cars/applications/resampling/resampling_algo.py +563 -0
  67. cars-1.0.0a1/cars/applications/resampling/resampling_wrappers.py +296 -0
  68. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/sparse_matching/__init__.py +4 -2
  69. cars-0.12.0rc2/cars/applications/sparse_matching/sparse_matching.py → cars-1.0.0a1/cars/applications/sparse_matching/abstract_sparse_matching_app.py +13 -11
  70. cars-0.12.0rc2/cars/applications/sparse_matching/sift.py → cars-1.0.0a1/cars/applications/sparse_matching/sift_app.py +79 -8
  71. cars-1.0.0a1/cars/applications/sparse_matching/sparse_matching_algo.py +326 -0
  72. cars-1.0.0a1/cars/applications/sparse_matching/sparse_matching_wrappers.py +287 -0
  73. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/triangulation/__init__.py +4 -2
  74. cars-0.12.0rc2/cars/applications/triangulation/triangulation.py → cars-1.0.0a1/cars/applications/triangulation/abstract_triangulation_app.py +3 -3
  75. cars-0.12.0rc2/cars/applications/triangulation/line_of_sight_intersection.py → cars-1.0.0a1/cars/applications/triangulation/line_of_sight_intersection_app.py +49 -53
  76. cars-0.12.0rc2/cars/applications/triangulation/triangulation_tools.py → cars-1.0.0a1/cars/applications/triangulation/triangulation_algo.py +9 -232
  77. cars-1.0.0a1/cars/applications/triangulation/triangulation_wrappers.py +257 -0
  78. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/bundleadjustment.py +3 -2
  79. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/cars.py +10 -4
  80. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/constants.py +11 -5
  81. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/datasets.py +13 -18
  82. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/geometry/abstract_geometry.py +90 -79
  83. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/geometry/shareloc_geometry.py +17 -19
  84. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/inputs.py +10 -3
  85. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/preprocessing.py +30 -42
  86. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/projection.py +1 -0
  87. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/data_structures/cars_dataset.py +2 -2
  88. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/devibrate.py +1 -1
  89. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/extractroi.py +44 -13
  90. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/log_wrapper.py +7 -2
  91. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/sequential_cluster.py +1 -1
  92. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/orchestrator.py +18 -9
  93. cars-1.0.0a1/cars/pipelines/conf_resolution/conf_final_resolution.json +7 -0
  94. cars-1.0.0a1/cars/pipelines/conf_resolution/conf_first_resolution.json +1 -0
  95. cars-1.0.0a1/cars/pipelines/conf_resolution/conf_intermediate_resolution.json +1 -0
  96. cars-1.0.0a1/cars/pipelines/default/default_pipeline.py +1256 -0
  97. cars-1.0.0a1/cars/pipelines/parameters/__init__.py +0 -0
  98. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/advanced_parameters.py +71 -3
  99. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/advanced_parameters_constants.py +6 -0
  100. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/depth_map_inputs.py +1 -1
  101. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/dsm_inputs.py +8 -7
  102. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/output_constants.py +5 -1
  103. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/output_parameters.py +23 -5
  104. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/sensor_inputs.py +75 -51
  105. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/sensor_inputs_constants.py +1 -1
  106. cars-1.0.0a1/cars/pipelines/parameters/sensor_loaders/__init__.py +27 -0
  107. cars-1.0.0a1/cars/pipelines/parameters/sensor_loaders/basic_sensor_loader.py +108 -0
  108. cars-1.0.0a1/cars/pipelines/parameters/sensor_loaders/pivot_sensor_loader.py +130 -0
  109. cars-1.0.0a1/cars/pipelines/parameters/sensor_loaders/sensor_loader.py +97 -0
  110. cars-1.0.0a1/cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +73 -0
  111. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/pipeline_template.py +3 -27
  112. cars-1.0.0a1/cars/pipelines/unit/__init__.py +26 -0
  113. cars-0.12.0rc2/cars/pipelines/default/default_pipeline.py → cars-1.0.0a1/cars/pipelines/unit/unit_pipeline.py +583 -419
  114. cars-1.0.0a1/ci/cars-deps-env/Dockerfile +35 -0
  115. cars-1.0.0a1/ci/cars-docker-build.yml +37 -0
  116. cars-1.0.0a1/ci/cars-no-docker-build.yml +7 -0
  117. cars-1.0.0a1/ci/hadolint_RNC_A_B_C_D.yaml +42 -0
  118. {cars-0.12.0rc2 → cars-1.0.0a1}/meson.build +1 -1
  119. {cars-0.12.0rc2 → cars-1.0.0a1}/pyproject.toml +2 -2
  120. cars-1.0.0a1/ref_updating.py +129 -0
  121. {cars-0.12.0rc2 → cars-1.0.0a1}/sonar-project.properties +5 -3
  122. cars-0.12.0rc2/cars/applications/dem_generation/dem_generation_tools.py +0 -127
  123. cars-0.12.0rc2/cars/applications/point_cloud_fusion/point_cloud_tools.py +0 -934
  124. cars-0.12.0rc2/cars/applications/resampling/resampling_tools.py +0 -484
  125. cars-0.12.0rc2/cars/applications/sparse_matching/pandora_sparse_matching.py +0 -814
  126. cars-0.12.0rc2/cars/applications/sparse_matching/sparse_matching_tools.py +0 -910
  127. {cars-0.12.0rc2 → cars-1.0.0a1}/.coveragerc +0 -0
  128. {cars-0.12.0rc2 → cars-1.0.0a1}/.dockerignore +0 -0
  129. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitattributes +0 -0
  130. {cars-0.12.0rc2 → cars-1.0.0a1}/.github/workflows/cars-ci.yml +0 -0
  131. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitignore +0 -0
  132. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitlab/issue_templates/Bug.md +0 -0
  133. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitlab/issue_templates/Proposal.md +0 -0
  134. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitlab/issue_templates/Refacto.md +0 -0
  135. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitlab/issue_templates/Release.md +0 -0
  136. {cars-0.12.0rc2 → cars-1.0.0a1}/.gitlab/merge_request_templates/MR.md +0 -0
  137. {cars-0.12.0rc2 → cars-1.0.0a1}/.pre-commit-config.yaml +0 -0
  138. {cars-0.12.0rc2 → cars-1.0.0a1}/.pylintrc +0 -0
  139. {cars-0.12.0rc2 → cars-1.0.0a1}/.readthedocs.yaml +0 -0
  140. {cars-0.12.0rc2 → cars-1.0.0a1}/CHANGELOG.md +0 -0
  141. {cars-0.12.0rc2 → cars-1.0.0a1}/CONTRIBUTING.md +0 -0
  142. {cars-0.12.0rc2 → cars-1.0.0a1}/Dockerfile +0 -0
  143. {cars-0.12.0rc2 → cars-1.0.0a1}/LICENSE +0 -0
  144. {cars-0.12.0rc2 → cars-1.0.0a1}/MANIFEST.in +0 -0
  145. {cars-0.12.0rc2 → cars-1.0.0a1}/Makefile +0 -0
  146. {cars-0.12.0rc2 → cars-1.0.0a1}/NOTICE +0 -0
  147. {cars-0.12.0rc2 → cars-1.0.0a1}/README.md +0 -0
  148. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/__init__.py +0 -0
  149. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/__init__.py +0 -0
  150. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/application.py +0 -0
  151. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/application_constants.py +0 -0
  152. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/application_template.py +0 -0
  153. /cars-0.12.0rc2/cars/applications/auxiliary_filling/auxiliary_filling.py → /cars-1.0.0a1/cars/applications/auxiliary_filling/abstract_auxiliary_filling_app.py +0 -0
  154. /cars-0.12.0rc2/cars/applications/dem_generation/dem_generation.py → /cars-1.0.0a1/cars/applications/dem_generation/abstract_dem_generation_app.py +0 -0
  155. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dem_generation/bulldozer_config/base_config.yaml +0 -0
  156. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dem_generation/dem_generation_constants.py +0 -0
  157. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/cpp/__init__.py +0 -0
  158. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.py +0 -0
  159. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/cpp/includes/dense_match_filling.hpp +0 -0
  160. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/cpp/meson.build +0 -0
  161. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/cpp/src/bindings.cpp +0 -0
  162. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/cpp/src/dense_match_filling.cpp +0 -0
  163. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_match_filling/fill_disp_constants.py +0 -0
  164. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/cpp/__init__.py +0 -0
  165. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/cpp/meson.build +0 -0
  166. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/cpp/src/bindings.cpp +0 -0
  167. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/dense_matching_constants.py +0 -0
  168. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/__init__.py +0 -0
  169. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_census_sgm_default.json +0 -0
  170. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_census_sgm_homogeneous.json +0 -0
  171. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_census_sgm_mountain_and_vegetation.json +0 -0
  172. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_census_sgm_shadow.json +0 -0
  173. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_census_sgm_urban.json +0 -0
  174. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dense_matching/loaders/config_mccnn.json +0 -0
  175. /cars-0.12.0rc2/cars/applications/dsm_filling/dsm_filling.py → /cars-1.0.0a1/cars/applications/dsm_filling/abstract_dsm_filling_app.py +0 -0
  176. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/dsm_filling/bulldozer_config/base_config.yaml +0 -0
  177. /cars-0.12.0rc2/cars/applications/grid_generation/grid_generation.py → /cars-1.0.0a1/cars/applications/grid_generation/abstract_grid_generation_app.py +0 -0
  178. /cars-0.12.0rc2/cars/applications/hole_detection/hole_detection.py → /cars-1.0.0a1/cars/applications/hole_detection/abstract_hole_detection_app.py +0 -0
  179. /cars-0.12.0rc2/cars/applications/point_cloud_denoising/point_cloud_denoising.py → /cars-1.0.0a1/cars/applications/point_cloud_denoising/abstract_pc_denoising_app.py +0 -0
  180. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/point_cloud_fusion/cloud_fusion_constants.py +0 -0
  181. /cars-0.12.0rc2/cars/applications/point_cloud_outlier_removal/point_removal_constants.py → /cars-1.0.0a1/cars/applications/point_cloud_outlier_removal/outlier_removal_constants.py +0 -0
  182. /cars-0.12.0rc2/cars/applications/rasterization/point_cloud_rasterization.py → /cars-1.0.0a1/cars/applications/rasterization/abstract_pc_rasterization_app.py +0 -0
  183. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/resampling/resampling_constants.py +0 -0
  184. /cars-0.12.0rc2/cars/pipelines/parameters/__init__.py → /cars-1.0.0a1/cars/applications/sparse_matching/pandora_sparse_matching_app.py +0 -0
  185. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/sparse_matching/sparse_matching_constants.py +0 -0
  186. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/applications/triangulation/triangulation_constants.py +0 -0
  187. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/conf/__init__.py +0 -0
  188. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/conf/geoid/egm96.grd +0 -0
  189. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/conf/geoid/egm96.grd.hdr +0 -0
  190. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/conf/input_parameters.py +0 -0
  191. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/conf/mask_cst.py +0 -0
  192. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/__init__.py +0 -0
  193. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/cars_logging.py +0 -0
  194. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/constants_disparity.py +0 -0
  195. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/geometry/__init__.py +0 -0
  196. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/outputs.py +0 -0
  197. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/roi_tools.py +0 -0
  198. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/tiling.py +0 -0
  199. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/core/utils.py +0 -0
  200. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/data_structures/__init__.py +0 -0
  201. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/data_structures/cars_dict.py +0 -0
  202. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/data_structures/corresponding_tiles_tools.py +0 -0
  203. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/data_structures/dataframe_converter.py +0 -0
  204. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/data_structures/format_transformation.py +0 -0
  205. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/__init__.py +0 -0
  206. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/achievement_tracker.py +0 -0
  207. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/__init__.py +0 -0
  208. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/abstract_cluster.py +0 -0
  209. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/abstract_dask_cluster.py +0 -0
  210. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_cluster_tools.py +0 -0
  211. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/README.md +0 -0
  212. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/dask.yaml +0 -0
  213. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/distributed.yaml +0 -0
  214. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/jobqueue.yaml +0 -0
  215. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/reference_confs/dask-schema.yaml +0 -0
  216. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/reference_confs/dask.yaml +0 -0
  217. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/reference_confs/distributed-schema.yaml +0 -0
  218. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/reference_confs/distributed.yaml +0 -0
  219. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_config/reference_confs/jobqueue.yaml +0 -0
  220. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/dask_jobqueue_utils.py +0 -0
  221. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/local_dask_cluster.py +0 -0
  222. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/__init__.py +0 -0
  223. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/mp_factorizer.py +0 -0
  224. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/mp_objects.py +0 -0
  225. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/mp_tools.py +0 -0
  226. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/mp_wrapper.py +0 -0
  227. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +0 -0
  228. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/mp_cluster/multiprocessing_profiler.py +0 -0
  229. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/pbs_dask_cluster.py +0 -0
  230. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/cluster/slurm_dask_cluster.py +0 -0
  231. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/orchestrator_constants.py +0 -0
  232. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/__init__.py +0 -0
  233. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/abstract_registry.py +0 -0
  234. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/compute_registry.py +0 -0
  235. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/id_generator.py +0 -0
  236. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/replacer_registry.py +0 -0
  237. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/saver_registry.py +0 -0
  238. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/registry/unseen_registry.py +0 -0
  239. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/orchestrator/tiles_profiler.py +0 -0
  240. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/__init__.py +0 -0
  241. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/default/__init__.py +0 -0
  242. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/depth_map_inputs_constants.py +0 -0
  243. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/parameters/dsm_inputs_constants.py +0 -0
  244. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/pipeline.py +0 -0
  245. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/pipelines/pipeline_constants.py +0 -0
  246. {cars-0.12.0rc2 → cars-1.0.0a1}/cars/starter.py +0 -0
  247. {cars-0.12.0rc2 → cars-1.0.0a1}/pytest.ini +0 -0
  248. {cars-0.12.0rc2 → cars-1.0.0a1}/setup.py +0 -0
  249. {cars-0.12.0rc2 → cars-1.0.0a1}/version.py +0 -0
@@ -0,0 +1,161 @@
1
+ workflow:
2
+ rules:
3
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
4
+ - if: $CI_COMMIT_REF_NAME == "master"
5
+
6
+ stages:
7
+ - init
8
+ - build
9
+ - test
10
+ - sonarqube
11
+ - sync
12
+
13
+
14
+ variables:
15
+ # Token used to push reports to SonarQube
16
+ SONARQUBE_TOKEN: "${CARS_CI_SONARQUBE_TOKEN}"
17
+
18
+ # Git variables
19
+ # Limit git depth to speed up cloning
20
+ GIT_DEPTH: 1
21
+
22
+ include:
23
+ # Sonarqube job
24
+ - project: "usinelogicielle/public/gitlab-ci-templates" # Inclut le stage de qualité sonarqube
25
+ ref: v1.1.3 # référence de tag
26
+ file: "jobs/sonarqube-gitlab-ci.yml"
27
+ # Variable defintion
28
+ - component: $CI_SERVER_FQDN/dali/cars-park/cars-ci/cars-ci-variables@master
29
+ # Jobs for gitlab-github synchronisation
30
+ - component: $CI_SERVER_FQDN/dali/cars-park/cars-ci/cars-ci-github@master
31
+ # Docker building and image selection
32
+ # First case: no need to update env, use latest version
33
+ - local: '/ci/cars-no-docker-build.yml'
34
+ rules:
35
+ # do not trigger this case if env has changed(see second case)
36
+ - changes:
37
+ - "ci/cars-deps-env/Dockerfile"
38
+ - "pyproject.toml"
39
+ when: never
40
+ # do not trigger this case on master (see third case)
41
+ - if: $CI_COMMIT_REF_NAME == "master"
42
+ when: never
43
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
44
+ # Second case: env should be generated on a dev branch, create a temporary
45
+ # image
46
+ - local: '/ci/cars-docker-build.yml'
47
+ inputs:
48
+ tag: ${CI_COMMIT_REF_NAME}
49
+ rules:
50
+ - changes:
51
+ - "ci/cars-deps-env/Dockerfile"
52
+ - "pyproject.toml"
53
+ # do not trigger this case on master (see third case)
54
+ - if: $CI_COMMIT_REF_NAME == "master"
55
+ when: never
56
+ # Third case: master branch pipeline: generate a "latest" image
57
+ - local: '/ci/cars-docker-build.yml'
58
+ inputs:
59
+ tag: "latest"
60
+ rules:
61
+ - if: $CI_COMMIT_REF_NAME == "master"
62
+
63
+ # Common part for jobs using python: use env image and install cars
64
+ .cars-python-job:
65
+ image: ${UL_ARTIFACTORY_HOST}/${CARS_ENV_IMAGE_NAME}:${CARS_ENV_IMAGE_TAG}
66
+ before_script:
67
+ - source /app/cars/venv/bin/activate
68
+ # All dependencies should already be installed in the docker env
69
+ - pip install --no-build-isolation --editable .[dev,docs,notebook]
70
+
71
+
72
+ # run unit tests before other tasks (lint, quality, end2end ...) to catch early
73
+ # errors
74
+ unit-test:
75
+ stage: test
76
+ extends:
77
+ - .cars-python-job
78
+ script:
79
+ - CARS_VENV="/app/cars/venv" make test/ci
80
+ artifacts:
81
+ paths:
82
+ - ./pytest-report.xml
83
+ - ./coverage.xml
84
+ expire_in: 1 day
85
+
86
+
87
+ # Job testing that notebooks run properly in Python
88
+ test-notebooks:
89
+ stage: test
90
+ needs:
91
+ - unit-test
92
+ extends:
93
+ - .cars-python-job
94
+ script:
95
+ # Install additional plugin dependencies required for the tests
96
+ - source /app/cars/venv/bin/activate
97
+ - pip install --no-build-isolation --editable .[pandora_mccnn,bundleadjustment]
98
+ - CARS_VENV="/app/cars/venv" make test/notebook
99
+
100
+ # test on full cars pipelines
101
+ test-end2end:
102
+ stage: test
103
+ needs:
104
+ - unit-test
105
+ # Use dedicated runner for end2end tests
106
+ tags:
107
+ - ${TEST_RUNNER_TAG}
108
+ timeout: 80 minutes
109
+ extends:
110
+ - .cars-python-job
111
+ script:
112
+ - source /app/cars/venv/bin/activate
113
+ - pytest -m "end2end_tests"
114
+ artifacts:
115
+ paths:
116
+ - tests/data/intermediate_data
117
+ when: always
118
+ expire_in: 1 day
119
+
120
+
121
+
122
+ # All lint tasks are performed in the same job to save up on job initialization
123
+ # time
124
+ lint:
125
+ stage: test
126
+ needs:
127
+ - unit-test
128
+ extends:
129
+ - .cars-python-job
130
+ allow_failure: true
131
+ script:
132
+ - CARS_VENV="/app/cars/venv" make lint
133
+ artifacts:
134
+ paths:
135
+ - ./pylint-report.txt
136
+ expire_in: 1 day
137
+
138
+
139
+ doc:
140
+ stage: test
141
+ needs:
142
+ - unit-test
143
+ extends:
144
+ - .cars-python-job
145
+ script:
146
+ - CARS_VENV="/app/cars/venv" make docs
147
+ artifacts:
148
+ # Export documentation in artifact, it can be opened directly from gitlab
149
+ paths:
150
+ - ./docs/build/html/
151
+ expire_in: 1 day
152
+
153
+
154
+ # Push git project from gitlab to github
155
+ github-sync:
156
+ extends:
157
+ - .github-sync-base
158
+
159
+ variables:
160
+ BRANCH: "master"
161
+ GITHUB_URL: github.com/CNES/cars.git
@@ -38,7 +38,7 @@ This file keeps track of authors contributions.
38
38
  * Alice de Bardonneche-Richard <alice.de-bardonneche-richard@csgroup.eu>
39
39
  * Tommy Calendini <tommy.calendini@cs-soprasteria.com>
40
40
  * Dimitri Lallement <dimitri.lallement@cnes.fr>
41
- * Datafalk <louis@datafalk.com>
41
+ * Datafalk <research@datafalk.com>
42
42
  * Marian Rassat <marian.rassat@cs-soprasteria.com>
43
43
 
44
44
  Update here with new contributors.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cars
3
- Version: 0.12.0rc2
3
+ Version: 1.0.0a1
4
4
  Summary: A satellite multi view stereo pipeline
5
5
  Keywords: cars,3D,DEM,pandora,photogrammetry
6
6
  Author-Email: CNES <cars@cnes.fr>
@@ -38,7 +38,7 @@ Requires-Dist: urllib3<2.0,>=1.21.1
38
38
  Requires-Dist: laspy[laszip]
39
39
  Requires-Dist: tbb==2020.3.254
40
40
  Requires-Dist: numba
41
- Requires-Dist: pandora[sgm]==1.7.0
41
+ Requires-Dist: pandora[sgm]==1.7.1a1
42
42
  Requires-Dist: cars-rasterize==0.2.*
43
43
  Requires-Dist: cars-resample==0.1.*
44
44
  Requires-Dist: cars-filter==0.2.*
@@ -23,7 +23,7 @@ CARS auxiliary filling module init file
23
23
  """
24
24
  # flake8: noqa: F401
25
25
 
26
- import cars.applications.auxiliary_filling.auxiliary_filling
27
- from cars.applications.auxiliary_filling.auxiliary_filling_from_sensors import (
26
+ import cars.applications.auxiliary_filling.abstract_auxiliary_filling_app
27
+ from cars.applications.auxiliary_filling.auxiliary_filling_from_sensors_app import ( # pylint: disable=C0301
28
28
  AuxiliaryFilling,
29
29
  )
@@ -26,9 +26,6 @@ this module contains the AuxiliaryFillingFromSensors application class.
26
26
  import numpy as np
27
27
  import rasterio as rio
28
28
  from scipy import interpolate
29
- from shapely.geometry import Polygon
30
-
31
- from cars.core.projection import polygon_projection
32
29
 
33
30
 
34
31
  def fill_auxiliary(
@@ -40,7 +37,8 @@ def fill_auxiliary(
40
37
  geom_plugin,
41
38
  number_of_color_bands,
42
39
  number_of_classification_bands,
43
- color_interpolator,
40
+ texture_bands,
41
+ texture_interpolator,
44
42
  use_mask=False,
45
43
  ):
46
44
  """
@@ -63,9 +61,11 @@ def fill_auxiliary(
63
61
  :type number_of_color_bands: int
64
62
  :param number_of_classification_bands: number of bands in the color image
65
63
  :type number_of_classification_bands: int
66
- :param color_interpolator: scipy interpolator use to interpolate color
64
+ :param texture_bands: list of band names used for output texture
65
+ :type texture_bands: list
66
+ :param texture_interpolator: scipy interpolator use to interpolate color
67
67
  values
68
- :type color_interpolator: str
68
+ :type texture_interpolator: str
69
69
  :param use_mask: use mask information from sensors in color computation
70
70
  :type use_mask: bool
71
71
 
@@ -107,7 +107,8 @@ def fill_auxiliary(
107
107
  geom_plugin,
108
108
  number_of_color_bands,
109
109
  number_of_classification_bands,
110
- color_interpolator,
110
+ texture_bands,
111
+ texture_interpolator,
111
112
  not_interpolated_mask=None,
112
113
  use_mask=use_mask,
113
114
  return_all_points=True,
@@ -132,7 +133,8 @@ def fill_auxiliary(
132
133
  geom_plugin,
133
134
  number_of_color_bands,
134
135
  number_of_classification_bands,
135
- color_interpolator,
136
+ texture_bands,
137
+ texture_interpolator,
136
138
  not_interpolated_mask,
137
139
  use_mask=use_mask,
138
140
  return_all_points=False,
@@ -165,7 +167,8 @@ def fill_from_one_sensor( # noqa C901
165
167
  geom_plugin,
166
168
  number_of_color_bands,
167
169
  number_of_classification_bands,
168
- color_interpolator,
170
+ texture_bands,
171
+ texture_interpolator,
169
172
  not_interpolated_mask=None,
170
173
  use_mask=False,
171
174
  return_all_points=False,
@@ -194,9 +197,11 @@ def fill_from_one_sensor( # noqa C901
194
197
  :type number_of_color_bands: int
195
198
  :param number_of_classification_bands: number of bands in the color image
196
199
  :type number_of_classification_bands: int
197
- :param color_interpolator: scipy interpolator use to interpolate color
200
+ :param texture_bands: list of band names used for output texture
201
+ :type texture_bands: list
202
+ :param texture_interpolator: scipy interpolator use to interpolate color
198
203
  values
199
- :type color_interpolator: str
204
+ :type texture_interpolator: str
200
205
  :param not_interpolated_mask: use mask information in color computation
201
206
  :type not_interpolated_mask: numpy.array
202
207
  :param use_mask: use mask information in color computation
@@ -207,9 +212,7 @@ def fill_from_one_sensor( # noqa C901
207
212
  """
208
213
 
209
214
  # Check if the sensor has color or classification
210
- reference_sensor_image = sensor.get(
211
- "color", sensor.get("classification", None)
212
- )
215
+ reference_sensor_image = sensor["image"]["main_file"]
213
216
 
214
217
  output_not_interpolated_mask = np.ones(len(altitudes), dtype=bool)
215
218
  all_values = np.zeros((number_of_color_bands, len(altitudes)))
@@ -251,12 +254,12 @@ def fill_from_one_sensor( # noqa C901
251
254
  ):
252
255
  return output_not_interpolated_mask, all_values
253
256
 
254
- if color_interpolator in ("linear", "nearest"):
255
- color_interpolator_margin = 1
256
- elif color_interpolator == "cubic":
257
- color_interpolator_margin = 3
257
+ if texture_interpolator in ("linear", "nearest"):
258
+ texture_interpolator_margin = 1
259
+ elif texture_interpolator == "cubic":
260
+ texture_interpolator_margin = 3
258
261
  else:
259
- raise RuntimeError(f"Invalid interpolator {color_interpolator}")
262
+ raise RuntimeError(f"Invalid interpolator {texture_interpolator}")
260
263
 
261
264
  # Classification interpolator is always nearest
262
265
  classif_interpolator = "nearest"
@@ -308,100 +311,112 @@ def fill_from_one_sensor( # noqa C901
308
311
  validity_mask, not_interpolated_mask
309
312
  )
310
313
 
311
- if sensor.get("color"):
312
- with rio.open(sensor["color"]) as sensor_color_image:
313
- # Only fill color if the number of bands matches. For exemple do
314
- # not try to fill an output RGB image from a greyscale "color"
315
- # image.
316
- if sensor_color_image.count == number_of_color_bands:
314
+ if sensor.get("image"):
315
+ # Only fill color if all texture bands are present
316
+ if all(
317
+ band_name in sensor["image"]["bands"] for band_name in texture_bands
318
+ ):
319
+ with rio.open(sensor["image"]["main_file"]) as sensor_color_image:
317
320
  first_row = np.floor(
318
- max(np.min(ind_rows_sensor) - color_interpolator_margin, 0)
321
+ max(
322
+ np.min(ind_rows_sensor) - texture_interpolator_margin, 0
323
+ )
319
324
  )
320
325
  last_row = np.ceil(
321
326
  min(
322
- np.max(ind_rows_sensor) + color_interpolator_margin,
327
+ np.max(ind_rows_sensor) + texture_interpolator_margin,
323
328
  sensor_color_image.height,
324
329
  )
325
330
  )
326
331
  first_col = np.floor(
327
- max(np.min(ind_cols_sensor) - color_interpolator_margin, 0)
332
+ max(
333
+ np.min(ind_cols_sensor) - texture_interpolator_margin, 0
334
+ )
328
335
  )
329
336
  last_col = np.ceil(
330
337
  min(
331
- np.max(ind_cols_sensor) + color_interpolator_margin,
338
+ np.max(ind_cols_sensor) + texture_interpolator_margin,
332
339
  sensor_color_image.width,
333
340
  )
334
341
  )
335
342
 
336
- rio_window = rio.windows.Window.from_slices(
337
- (first_row, last_row),
338
- (first_col, last_col),
339
- )
343
+ rio_window = rio.windows.Window.from_slices(
344
+ (first_row, last_row),
345
+ (first_col, last_col),
346
+ )
340
347
 
341
- sensor_points = (
342
- np.arange(first_row, last_row),
343
- np.arange(first_col, last_col),
344
- )
348
+ sensor_points = (
349
+ np.arange(first_row, last_row),
350
+ np.arange(first_col, last_col),
351
+ )
345
352
 
346
- if validity_mask is not None:
347
- interpolated_mask = validity_mask
348
- else:
349
- interpolated_mask = np.ones(len(altitudes), dtype=bool)
353
+ if validity_mask is not None:
354
+ interpolated_mask = validity_mask
355
+ else:
356
+ interpolated_mask = np.ones(len(altitudes), dtype=bool)
350
357
 
351
- for band in range(sensor_color_image.count):
352
- # rio band convention
353
- sensor_data = sensor_color_image.read(
354
- band + 1, window=rio_window
355
- )
358
+ for output_band, band_name in enumerate(texture_bands):
359
+ # rio band convention
360
+ sensor_file = rio.open(
361
+ sensor["image"]["bands"][band_name]["path"]
362
+ )
363
+ input_band = sensor["image"]["bands"][band_name]["band"]
364
+ sensor_data = sensor_file.read(
365
+ input_band + 1, window=rio_window
366
+ )
356
367
 
357
- if validity_mask is not None:
358
- if return_all_points is True:
359
- all_values[band, :] = interpolate.interpn(
360
- sensor_points,
361
- sensor_data,
362
- (ind_rows_sensor, ind_cols_sensor),
363
- bounds_error=False,
364
- method=color_interpolator,
365
- )
366
- band_values = all_values[band, validity_mask]
367
- # No need to interpolate on every points
368
- else:
369
- band_values = interpolate.interpn(
370
- sensor_points,
371
- sensor_data,
372
- (
373
- ind_rows_sensor[validity_mask],
374
- ind_cols_sensor[validity_mask],
375
- ),
376
- bounds_error=False,
377
- method=color_interpolator,
378
- )
379
- nan_values = np.isnan(band_values)
380
- interpolated_mask[validity_mask] = np.logical_or(
381
- interpolated_mask[validity_mask], ~nan_values
368
+ if validity_mask is not None:
369
+ if return_all_points is True:
370
+ all_values[output_band, :] = interpolate.interpn(
371
+ sensor_points,
372
+ sensor_data,
373
+ (ind_rows_sensor, ind_cols_sensor),
374
+ bounds_error=False,
375
+ method=texture_interpolator,
382
376
  )
383
- filled_color[band, interpolated_mask] += band_values
384
-
377
+ band_values = all_values[output_band, validity_mask]
378
+ # No need to interpolate on every points
385
379
  else:
386
380
  band_values = interpolate.interpn(
387
381
  sensor_points,
388
382
  sensor_data,
389
- (ind_rows_sensor, ind_cols_sensor),
383
+ (
384
+ ind_rows_sensor[validity_mask],
385
+ ind_cols_sensor[validity_mask],
386
+ ),
390
387
  bounds_error=False,
391
- method=color_interpolator,
388
+ method=texture_interpolator,
392
389
  )
393
- interpolated_mask = np.logical_or(
394
- interpolated_mask, ~np.isnan(band_values)
395
- )
396
- filled_color[band, interpolated_mask] += band_values
397
- output_not_interpolated_mask = ~interpolated_mask
390
+ nan_values = np.isnan(band_values)
391
+ interpolated_mask[validity_mask] = np.logical_or(
392
+ interpolated_mask[validity_mask], ~nan_values
393
+ )
394
+ filled_color[output_band, interpolated_mask] += band_values
398
395
 
399
- weights[interpolated_mask] += 1
396
+ else:
397
+ band_values = interpolate.interpn(
398
+ sensor_points,
399
+ sensor_data,
400
+ (ind_rows_sensor, ind_cols_sensor),
401
+ bounds_error=False,
402
+ method=texture_interpolator,
403
+ )
404
+ interpolated_mask = np.logical_or(
405
+ interpolated_mask, ~np.isnan(band_values)
406
+ )
407
+ filled_color[output_band, interpolated_mask] += band_values
408
+ output_not_interpolated_mask = ~interpolated_mask
409
+
410
+ weights[interpolated_mask] += 1
400
411
 
401
412
  if filled_classif is not None and sensor.get("classification"):
402
- with rio.open(sensor["classification"]) as sensor_classif_image:
413
+ if number_of_classification_bands == len(
414
+ sensor["classification"]["bands"]
415
+ ):
416
+ with rio.open(
417
+ sensor["classification"]["main_file"]
418
+ ) as sensor_classif_image:
403
419
 
404
- if sensor_classif_image.count == number_of_classification_bands:
405
420
  first_row = np.floor(
406
421
  max(
407
422
  np.min(ind_rows_sensor) - classif_interpolator_margin, 0
@@ -425,95 +440,39 @@ def fill_from_one_sensor( # noqa C901
425
440
  )
426
441
  )
427
442
 
428
- rio_window = rio.windows.Window.from_slices(
429
- (first_row, last_row),
430
- (first_col, last_col),
431
- )
443
+ rio_window = rio.windows.Window.from_slices(
444
+ (first_row, last_row),
445
+ (first_col, last_col),
446
+ )
432
447
 
433
- sensor_points = (
434
- np.arange(first_row, last_row),
435
- np.arange(first_col, last_col),
436
- )
448
+ sensor_points = (
449
+ np.arange(first_row, last_row),
450
+ np.arange(first_col, last_col),
451
+ )
437
452
 
438
- for band in range(sensor_classif_image.count):
439
- # rio band convention
440
- sensor_data = sensor_classif_image.read(
441
- band + 1, window=rio_window, out_dtype=np.uint8
442
- )
453
+ for output_band, band_name in enumerate(
454
+ sensor["classification"]["bands"]
455
+ ):
456
+ # rio band convention
457
+ sensor_file = rio.open(
458
+ sensor["classification"]["bands"][band_name]["path"]
459
+ )
460
+ input_band = sensor["classification"]["bands"][band_name][
461
+ "band"
462
+ ]
463
+ sensor_data = sensor_file.read(
464
+ input_band + 1, window=rio_window
465
+ )
443
466
 
444
- filled_classif[band, :] = np.logical_or(
445
- filled_classif[band, :],
446
- interpolate.interpn(
447
- sensor_points,
448
- sensor_data,
449
- (ind_rows_sensor, ind_cols_sensor),
450
- bounds_error=False,
451
- method=classif_interpolator,
452
- ),
453
- )
467
+ filled_classif[output_band, :] = np.logical_or(
468
+ filled_classif[output_band, :],
469
+ interpolate.interpn(
470
+ sensor_points,
471
+ sensor_data,
472
+ (ind_rows_sensor, ind_cols_sensor),
473
+ bounds_error=False,
474
+ method=classif_interpolator,
475
+ ),
476
+ )
454
477
 
455
478
  return output_not_interpolated_mask, all_values
456
-
457
-
458
- def compute_sensor_bounds(sensor_inputs, geom_plugin, output_epsg):
459
- """
460
- Compute bounds of each input sensor that have an associated color or
461
- classification image
462
-
463
- :param sensor_inputs: dictionary containing paths to input images and models
464
- :type sensor_inputs: dict
465
- :param geom_plugin: geometry plugin used for inverse locations
466
- :type geom_plugin: AbstractGeometry
467
- :param geom_plugin: geometry plugin used for inverse locations
468
- :type geom_plugin: AbstractGeometry
469
- :param output_epsg: epsg of the output polygons
470
- :type output_epsg: int
471
-
472
- :return: a dictionary containing a Polygon in output geometry for each
473
- valid input sensor
474
- """
475
-
476
- sensor_bounds = {}
477
-
478
- for sensor_name, sensor in sensor_inputs.items():
479
- reference_sensor_image = sensor.get(
480
- "color", sensor.get("classification", None)
481
- )
482
- # no data for this sensor, no need to compute its bounds
483
- if reference_sensor_image is None:
484
- continue
485
-
486
- u_l, u_r, l_r, l_l = geom_plugin.image_envelope(
487
- reference_sensor_image, sensor["geomodel"]
488
- )
489
-
490
- poly_geo = Polygon([u_l, u_r, l_r, l_l, u_l])
491
-
492
- sensor_bounds[sensor_name] = polygon_projection(
493
- poly_geo, 4326, output_epsg
494
- )
495
-
496
- return sensor_bounds
497
-
498
-
499
- def filter_sensor_inputs(sensor_inputs, sensor_bounds, ground_polygon):
500
- """
501
- Filter input sensors by comparing their bounds to a reference Polygon
502
-
503
- :param sensor_inputs: dictionary containing paths to input images and models
504
- :type sensor_inputs: dict
505
- :param sensor_bounds: dictionary containing bounds of input sensors
506
- :type sensor_bounds: dict
507
- :param ground_polygon: reference polygon, in ground geometry
508
- :type ground_polygon: Polygon
509
-
510
- :return: a fitlered version of sensor_inputs
511
- """
512
-
513
- filtered_sensor_inputs = sensor_inputs.copy()
514
-
515
- for sensor_name, bound in sensor_bounds.items():
516
- if not bound.intersects(ground_polygon):
517
- del filtered_sensor_inputs[sensor_name]
518
-
519
- return filtered_sensor_inputs