cars 1.0.0a2__cp312-cp312-win_amd64.whl → 1.0.0a3__cp312-cp312-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 (53) hide show
  1. cars/applications/application.py +14 -6
  2. cars/applications/application_template.py +22 -0
  3. cars/applications/auxiliary_filling/auxiliary_filling_from_sensors_app.py +15 -10
  4. cars/applications/auxiliary_filling/auxiliary_filling_wrappers.py +7 -6
  5. cars/applications/dem_generation/abstract_dem_generation_app.py +9 -5
  6. cars/applications/dem_generation/dem_generation_wrappers.py +46 -27
  7. cars/applications/dem_generation/dichotomic_generation_app.py +6 -3
  8. cars/applications/dem_generation/rasterization_app.py +15 -5
  9. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp312-win_amd64.dll.a +0 -0
  10. cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp312-win_amd64.pyd +0 -0
  11. cars/applications/dense_matching/census_mccnn_sgm_app.py +11 -22
  12. cars/applications/dense_matching/cpp/dense_matching_cpp.cp312-win_amd64.dll.a +0 -0
  13. cars/applications/dense_matching/cpp/dense_matching_cpp.cp312-win_amd64.pyd +0 -0
  14. cars/applications/dense_matching/disparity_grid_algo.py +26 -32
  15. cars/applications/dense_matching/loaders/config_mapping.json +13 -0
  16. cars/applications/dense_matching/loaders/global_land_cover_map.tif +0 -0
  17. cars/applications/dense_matching/loaders/pandora_loader.py +78 -1
  18. cars/applications/dsm_filling/border_interpolation_app.py +10 -5
  19. cars/applications/dsm_filling/bulldozer_filling_app.py +14 -7
  20. cars/applications/dsm_filling/exogenous_filling_app.py +10 -5
  21. cars/applications/point_cloud_outlier_removal/abstract_outlier_removal_app.py +9 -5
  22. cars/applications/point_cloud_outlier_removal/small_components_app.py +5 -3
  23. cars/applications/point_cloud_outlier_removal/statistical_app.py +4 -2
  24. cars/applications/rasterization/abstract_pc_rasterization_app.py +1 -0
  25. cars/applications/rasterization/simple_gaussian_app.py +28 -3
  26. cars/applications/resampling/resampling_algo.py +44 -49
  27. cars/applications/sparse_matching/sift_app.py +2 -22
  28. cars/core/geometry/abstract_geometry.py +113 -2
  29. cars/core/geometry/shareloc_geometry.py +2 -0
  30. cars/core/inputs.py +15 -0
  31. cars/core/projection.py +117 -0
  32. cars/data_structures/cars_dataset.py +7 -5
  33. cars/orchestrator/cluster/log_wrapper.py +1 -1
  34. cars/orchestrator/cluster/mp_cluster/multiprocessing_cluster.py +1 -1
  35. cars/orchestrator/orchestrator.py +1 -1
  36. cars/pipelines/default/default_pipeline.py +46 -26
  37. cars/pipelines/parameters/advanced_parameters.py +17 -0
  38. cars/pipelines/parameters/advanced_parameters_constants.py +4 -0
  39. cars/pipelines/parameters/output_parameters.py +44 -8
  40. cars/pipelines/parameters/sensor_inputs.py +97 -3
  41. cars/pipelines/unit/unit_pipeline.py +194 -99
  42. cars-1.0.0a3.dist-info/DELVEWHEEL +2 -0
  43. {cars-1.0.0a2.dist-info → cars-1.0.0a3.dist-info}/METADATA +1 -1
  44. {cars-1.0.0a2.dist-info → cars-1.0.0a3.dist-info}/RECORD +49 -47
  45. cars.libs/libgcc_s_seh-1-ca70890bbc5723b6d0ea31e9c9cded2b.dll +0 -0
  46. cars.libs/libstdc++-6-00ee19f73d5122a1277c137b1c218401.dll +0 -0
  47. cars.libs/libwinpthread-1-f5042e8e3d21edce20c1bc99445f551b.dll +0 -0
  48. cars-1.0.0a2.dist-info/DELVEWHEEL +0 -2
  49. cars.libs/libgcc_s_seh-1-f2b6825d483bdf14050493af93b5997d.dll +0 -0
  50. cars.libs/libstdc++-6-6b0059df6bc601df5a0f18a5805eea05.dll +0 -0
  51. cars.libs/libwinpthread-1-e01b8e85fd67c2b861f64d4ccc7df607.dll +0 -0
  52. {cars-1.0.0a2.dist-info → cars-1.0.0a3.dist-info}/WHEEL +0 -0
  53. {cars-1.0.0a2.dist-info → cars-1.0.0a3.dist-info}/entry_points.txt +0 -0
@@ -36,6 +36,7 @@ import math
36
36
  import os
37
37
 
38
38
  import numpy as np
39
+ from pyproj import CRS
39
40
 
40
41
  import cars.applications.sparse_matching.sparse_matching_constants as sm_cst
41
42
  from cars import __version__
@@ -56,6 +57,7 @@ from cars.core import preprocessing, projection, roi_tools
56
57
  from cars.core.geometry.abstract_geometry import AbstractGeometry
57
58
  from cars.core.inputs import (
58
59
  get_descriptions_bands,
60
+ rasterio_get_crs,
59
61
  rasterio_get_epsg,
60
62
  rasterio_get_size,
61
63
  read_vector,
@@ -145,6 +147,9 @@ class UnitPipeline(PipelineTemplate):
145
147
  self.geom_plugin_without_dem_and_geoid,
146
148
  self.geom_plugin_with_dem_and_geoid,
147
149
  self.dem_generation_roi,
150
+ self.scaling_coeff,
151
+ self.land_cover_map,
152
+ self.classification_to_config_mapping,
148
153
  ) = advanced_parameters.check_advanced_parameters(
149
154
  inputs, conf.get(ADVANCED, {}), check_epipolar_a_priori=True
150
155
  )
@@ -161,7 +166,11 @@ class UnitPipeline(PipelineTemplate):
161
166
  self.debug_with_roi = self.used_conf[ADVANCED][adv_cst.DEBUG_WITH_ROI]
162
167
 
163
168
  # Check conf output
164
- output = self.check_output(conf[OUTPUT])
169
+ (
170
+ output,
171
+ self.scaling_coeff,
172
+ ) = self.check_output(conf[OUTPUT], self.scaling_coeff)
173
+
165
174
  self.used_conf[OUTPUT] = output
166
175
 
167
176
  prod_level = output[out_cst.PRODUCT_LEVEL]
@@ -459,17 +468,18 @@ class UnitPipeline(PipelineTemplate):
459
468
  return output_config
460
469
 
461
470
  @staticmethod
462
- def check_output(conf):
471
+ def check_output(conf, scaling_coeff):
463
472
  """
464
473
  Check the output given
465
474
 
466
475
  :param conf: configuration of output
467
476
  :type conf: dict
468
-
469
- :return overloader output
470
- :rtype : dict
477
+ :param scaling_coeff: scaling factor for resolution
478
+ :type scaling_coeff: float
479
+ :return: overloader output
480
+ :rtype: dict
471
481
  """
472
- return output_parameters.check_output_parameters(conf)
482
+ return output_parameters.check_output_parameters(conf, scaling_coeff)
473
483
 
474
484
  def check_applications( # noqa: C901 : too complex
475
485
  self,
@@ -483,6 +493,7 @@ class UnitPipeline(PipelineTemplate):
483
493
  :param conf: configuration of applications
484
494
  :type conf: dict
485
495
  """
496
+ scaling_coeff = self.scaling_coeff
486
497
 
487
498
  # Check if all specified applications are used
488
499
  # Application in terrain_application are note used in
@@ -580,7 +591,9 @@ class UnitPipeline(PipelineTemplate):
580
591
  if self.sensors_in_inputs:
581
592
  # Epipolar grid generation
582
593
  self.epipolar_grid_generation_application = Application(
583
- "grid_generation", cfg=used_conf.get("grid_generation", {})
594
+ "grid_generation",
595
+ cfg=used_conf.get("grid_generation", {}),
596
+ scaling_coeff=scaling_coeff,
584
597
  )
585
598
  used_conf["grid_generation"] = (
586
599
  self.epipolar_grid_generation_application.get_conf()
@@ -588,7 +601,9 @@ class UnitPipeline(PipelineTemplate):
588
601
 
589
602
  # image resampling
590
603
  self.resampling_application = Application(
591
- "resampling", cfg=used_conf.get("resampling", {})
604
+ "resampling",
605
+ cfg=used_conf.get("resampling", {}),
606
+ scaling_coeff=scaling_coeff,
592
607
  )
593
608
  used_conf["resampling"] = self.resampling_application.get_conf()
594
609
 
@@ -610,10 +625,13 @@ class UnitPipeline(PipelineTemplate):
610
625
  self.ground_truth_reprojection = Application(
611
626
  "ground_truth_reprojection",
612
627
  cfg=used_conf.get("ground_truth_reprojection", {}),
628
+ scaling_coeff=scaling_coeff,
613
629
  )
614
630
  # holes detection
615
631
  self.hole_detection_app = Application(
616
- "hole_detection", cfg=used_conf.get("hole_detection", {})
632
+ "hole_detection",
633
+ cfg=used_conf.get("hole_detection", {}),
634
+ scaling_coeff=scaling_coeff,
617
635
  )
618
636
  used_conf["hole_detection"] = self.hole_detection_app.get_conf()
619
637
 
@@ -624,6 +642,7 @@ class UnitPipeline(PipelineTemplate):
624
642
  "dense_match_filling.1",
625
643
  {"method": "plane"},
626
644
  ),
645
+ scaling_coeff=scaling_coeff,
627
646
  )
628
647
  used_conf["dense_match_filling.1"] = (
629
648
  self.dense_match_filling_1.get_conf()
@@ -636,6 +655,7 @@ class UnitPipeline(PipelineTemplate):
636
655
  "dense_match_filling.2",
637
656
  {"method": "zero_padding"},
638
657
  ),
658
+ scaling_coeff=scaling_coeff,
639
659
  )
640
660
  used_conf["dense_match_filling.2"] = (
641
661
  self.dense_match_filling_2.get_conf()
@@ -645,6 +665,7 @@ class UnitPipeline(PipelineTemplate):
645
665
  self.sparse_mtch_sift_app = Application(
646
666
  "sparse_matching",
647
667
  cfg=used_conf.get("sparse_matching.sift", {"method": "sift"}),
668
+ scaling_coeff=scaling_coeff,
648
669
  )
649
670
  used_conf["sparse_matching.sift"] = (
650
671
  self.sparse_mtch_sift_app.get_conf()
@@ -672,13 +693,17 @@ class UnitPipeline(PipelineTemplate):
672
693
  ):
673
694
  dense_matching_config["performance_map_method"] = "risk"
674
695
  self.dense_matching_app = Application(
675
- "dense_matching", cfg=dense_matching_config
696
+ "dense_matching",
697
+ cfg=dense_matching_config,
698
+ scaling_coeff=scaling_coeff,
676
699
  )
677
700
  used_conf["dense_matching"] = self.dense_matching_app.get_conf()
678
701
 
679
702
  # Triangulation
680
703
  self.triangulation_application = Application(
681
- "triangulation", cfg=used_conf.get("triangulation", {})
704
+ "triangulation",
705
+ cfg=used_conf.get("triangulation", {}),
706
+ scaling_coeff=scaling_coeff,
682
707
  )
683
708
  used_conf["triangulation"] = (
684
709
  self.triangulation_application.get_conf()
@@ -686,7 +711,9 @@ class UnitPipeline(PipelineTemplate):
686
711
 
687
712
  # MNT generation
688
713
  self.dem_generation_application = Application(
689
- "dem_generation", cfg=used_conf.get("dem_generation", {})
714
+ "dem_generation",
715
+ cfg=used_conf.get("dem_generation", {}),
716
+ scaling_coeff=scaling_coeff,
690
717
  )
691
718
  used_conf["dem_generation"] = (
692
719
  self.dem_generation_application.get_conf()
@@ -704,6 +731,7 @@ class UnitPipeline(PipelineTemplate):
704
731
  "point_cloud_outlier_removal.1",
705
732
  {"method": "small_components"},
706
733
  ),
734
+ scaling_coeff=scaling_coeff,
707
735
  )
708
736
  used_conf["point_cloud_outlier_removal.1"] = (
709
737
  self.pc_outlier_removal_1_app.get_conf()
@@ -716,6 +744,7 @@ class UnitPipeline(PipelineTemplate):
716
744
  "point_cloud_outlier_removal.2",
717
745
  {"method": "statistical"},
718
746
  ),
747
+ scaling_coeff=scaling_coeff,
719
748
  )
720
749
  used_conf["point_cloud_outlier_removal.2"] = (
721
750
  self.pc_outlier_removal_2_app.get_conf()
@@ -727,6 +756,7 @@ class UnitPipeline(PipelineTemplate):
727
756
  self.pc_denoising_application = Application(
728
757
  "pc_denoising",
729
758
  cfg=used_conf.get("pc_denoising", {"method": "none"}),
759
+ scaling_coeff=scaling_coeff,
730
760
  )
731
761
  used_conf["pc_denoising"] = self.pc_denoising_application.get_conf()
732
762
 
@@ -736,6 +766,7 @@ class UnitPipeline(PipelineTemplate):
736
766
  self.rasterization_application = Application(
737
767
  "point_cloud_rasterization",
738
768
  cfg=used_conf.get("point_cloud_rasterization", {}),
769
+ scaling_coeff=scaling_coeff,
739
770
  )
740
771
  used_conf["point_cloud_rasterization"] = (
741
772
  self.rasterization_application.get_conf()
@@ -747,6 +778,7 @@ class UnitPipeline(PipelineTemplate):
747
778
  "dsm_filling.1",
748
779
  {"method": "exogenous_filling"},
749
780
  ),
781
+ scaling_coeff=scaling_coeff,
750
782
  )
751
783
  used_conf["dsm_filling.1"] = (
752
784
  self.dsm_filling_1_application.get_conf()
@@ -769,22 +801,25 @@ class UnitPipeline(PipelineTemplate):
769
801
  "dsm_filling.3",
770
802
  {"method": "border_interpolation"},
771
803
  ),
804
+ scaling_coeff=scaling_coeff,
772
805
  )
773
806
  used_conf["dsm_filling.3"] = (
774
807
  self.dsm_filling_3_application.get_conf()
775
808
  )
776
809
  # Auxiliary filling
777
810
  self.auxiliary_filling_application = Application(
778
- "auxiliary_filling", cfg=conf.get("auxiliary_filling", {})
811
+ "auxiliary_filling",
812
+ cfg=conf.get("auxiliary_filling", {}),
813
+ scaling_coeff=scaling_coeff,
779
814
  )
780
815
  used_conf["auxiliary_filling"] = (
781
816
  self.auxiliary_filling_application.get_conf()
782
817
  )
783
818
 
784
819
  if (
785
- self.dsm_filling_1_application.classification
786
- or self.dsm_filling_2_application.classification
787
- or self.dsm_filling_3_application.classification
820
+ self.dsm_filling_1_application.classification != ["nodata"]
821
+ or self.dsm_filling_2_application.classification != ["nodata"]
822
+ or self.dsm_filling_3_application.classification != ["nodata"]
788
823
  ):
789
824
  self.save_output_classif_for_filling = True
790
825
 
@@ -794,6 +829,7 @@ class UnitPipeline(PipelineTemplate):
794
829
  self.pc_fusion_application = Application(
795
830
  "point_cloud_fusion",
796
831
  cfg=used_conf.get("point_cloud_fusion", {}),
832
+ scaling_coeff=scaling_coeff,
797
833
  )
798
834
  used_conf["point_cloud_fusion"] = (
799
835
  self.pc_fusion_application.get_conf()
@@ -914,7 +950,7 @@ class UnitPipeline(PipelineTemplate):
914
950
  ]
915
951
  if (
916
952
  "classification" in inputs_conf["sensors"][key2]
917
- and inputs_conf["sensors"][key1]["classification"] is not None
953
+ and inputs_conf["sensors"][key2]["classification"] is not None
918
954
  ):
919
955
  classif_right = inputs_conf["sensors"][key2]["classification"][
920
956
  "main_file"
@@ -1156,6 +1192,10 @@ class UnitPipeline(PipelineTemplate):
1156
1192
  # Run cluster breakpoint to compute sifts: force computation
1157
1193
  self.cars_orchestrator.breakpoint()
1158
1194
 
1195
+ minimum_nb_matches = (
1196
+ self.sparse_mtch_sift_app.get_minimum_nb_matches()
1197
+ )
1198
+
1159
1199
  # Run grid correction application
1160
1200
  if self.used_conf[ADVANCED][adv_cst.USE_EPIPOLAR_A_PRIORI] is False:
1161
1201
  # Estimate grid correction if no epipolar a priori
@@ -1177,10 +1217,6 @@ class UnitPipeline(PipelineTemplate):
1177
1217
  )
1178
1218
  )
1179
1219
 
1180
- minimum_nb_matches = (
1181
- self.sparse_mtch_sift_app.get_minimum_nb_matches()
1182
- )
1183
-
1184
1220
  # Compute grid correction
1185
1221
  (
1186
1222
  self.pairs[pair_key]["grid_correction_coef"],
@@ -1475,6 +1511,7 @@ class UnitPipeline(PipelineTemplate):
1475
1511
  new_grid_matches_array,
1476
1512
  self.pairs[pair_key]["grid_right"],
1477
1513
  save_matches=save_matches,
1514
+ minimum_nb_matches=minimum_nb_matches,
1478
1515
  pair_folder=os.path.join(
1479
1516
  self.dump_dir, "grid_correction", "new", pair_key
1480
1517
  ),
@@ -1781,6 +1818,7 @@ class UnitPipeline(PipelineTemplate):
1781
1818
  geoid=self.used_conf[ADVANCED][adv_cst.GROUND_TRUTH_DSM][
1782
1819
  adv_cst.INPUT_GEOID
1783
1820
  ],
1821
+ scaling_coeff=self.scaling_coeff,
1784
1822
  )
1785
1823
  self.ground_truth_reprojection.run(
1786
1824
  self.pairs[pair_key]["sensor_image_left"],
@@ -1804,6 +1842,131 @@ class UnitPipeline(PipelineTemplate):
1804
1842
  ),
1805
1843
  )
1806
1844
 
1845
+ if self.epsg is None:
1846
+ # compute epsg
1847
+ # Epsg uses global disparity min and max
1848
+ self.epsg = preprocessing.compute_epsg(
1849
+ self.pairs[pair_key]["sensor_image_left"],
1850
+ self.pairs[pair_key]["sensor_image_right"],
1851
+ self.pairs[pair_key]["corrected_grid_left"],
1852
+ self.pairs[pair_key]["corrected_grid_right"],
1853
+ self.geom_plugin_with_dem_and_geoid,
1854
+ disp_min=self.pairs[pair_key]["disp_range_grid"][
1855
+ "global_min"
1856
+ ],
1857
+ disp_max=self.pairs[pair_key]["disp_range_grid"][
1858
+ "global_max"
1859
+ ],
1860
+ )
1861
+ # Compute roi polygon, in input EPSG
1862
+ self.roi_poly = preprocessing.compute_roi_poly(
1863
+ self.input_roi_poly, self.input_roi_epsg, self.epsg
1864
+ )
1865
+
1866
+ self.vertical_crs = projection.get_output_crs(self.epsg, output)
1867
+
1868
+ if (
1869
+ self.save_output_dsm
1870
+ or self.save_output_point_cloud
1871
+ or self.dense_matching_app.get_method() == "auto"
1872
+ ):
1873
+ # Compute terrain bounding box /roi related to
1874
+ # current images
1875
+ (current_terrain_roi_bbox, intersection_poly) = (
1876
+ preprocessing.compute_terrain_bbox(
1877
+ self.pairs[pair_key]["sensor_image_left"],
1878
+ self.pairs[pair_key]["sensor_image_right"],
1879
+ new_epipolar_image_left,
1880
+ self.pairs[pair_key]["corrected_grid_left"],
1881
+ self.pairs[pair_key]["corrected_grid_right"],
1882
+ self.epsg,
1883
+ self.geom_plugin_with_dem_and_geoid,
1884
+ resolution=self.resolution,
1885
+ disp_min=self.pairs[pair_key]["disp_range_grid"][
1886
+ "global_min"
1887
+ ],
1888
+ disp_max=self.pairs[pair_key]["disp_range_grid"][
1889
+ "global_max"
1890
+ ],
1891
+ roi_poly=(
1892
+ None if self.debug_with_roi else self.roi_poly
1893
+ ),
1894
+ orchestrator=self.cars_orchestrator,
1895
+ pair_key=pair_key,
1896
+ pair_folder=os.path.join(
1897
+ self.dump_dir, "terrain_bbox", pair_key
1898
+ ),
1899
+ check_inputs=False,
1900
+ )
1901
+ )
1902
+ self.list_terrain_roi.append(current_terrain_roi_bbox)
1903
+ self.list_intersection_poly.append(intersection_poly)
1904
+
1905
+ # compute terrain bounds for later use
1906
+ (
1907
+ self.terrain_bounds,
1908
+ self.optimal_terrain_tile_width,
1909
+ ) = preprocessing.compute_terrain_bounds(
1910
+ self.list_terrain_roi,
1911
+ roi_poly=(None if self.debug_with_roi else self.roi_poly),
1912
+ resolution=self.resolution,
1913
+ )
1914
+
1915
+ if self.which_resolution not in ("final", "single"):
1916
+ # To get the correct size for the dem generation
1917
+ if self.dem_generation_roi is not None:
1918
+ # ROI has been computed by Shareloc
1919
+ self.terrain_bounds = (
1920
+ dem_wrappers.modify_terrain_bounds(
1921
+ self.dem_generation_roi.bounds,
1922
+ 4326,
1923
+ self.epsg,
1924
+ self.dem_generation_application.margin,
1925
+ )
1926
+ )
1927
+ else:
1928
+ # ROI has not been computed
1929
+ self.terrain_bounds = (
1930
+ dem_wrappers.modify_terrain_bounds(
1931
+ self.terrain_bounds,
1932
+ self.epsg,
1933
+ self.epsg,
1934
+ self.dem_generation_application.margin,
1935
+ 0.7,
1936
+ )
1937
+ )
1938
+
1939
+ if self.dense_matching_app.get_method() == "auto":
1940
+ # Copy the initial corr_config in order to keep
1941
+ # the inputs that have already been checked
1942
+ corr_cfg = self.dense_matching_app.corr_config.copy()
1943
+
1944
+ # Find the conf that correspond to the land cover map
1945
+ conf = self.dense_matching_app.loader.find_auto_conf(
1946
+ intersection_poly,
1947
+ self.land_cover_map,
1948
+ self.classification_to_config_mapping,
1949
+ self.epsg,
1950
+ )
1951
+
1952
+ # Update the used_conf if order to reinitialize
1953
+ # the dense matching app
1954
+ # Because we kept the information regarding the ambiguity,
1955
+ # performance_map calculus..
1956
+ self.used_conf["applications"]["dense_matching"]["loader_conf"][
1957
+ "pipeline"
1958
+ ] = conf["pipeline"]
1959
+
1960
+ # Re initialization of the dense matching application
1961
+ self.dense_matching_app = Application(
1962
+ "dense_matching",
1963
+ cfg=self.used_conf["applications"]["dense_matching"],
1964
+ )
1965
+
1966
+ # Update the corr_config with the inputs that have
1967
+ # already been checked
1968
+ self.dense_matching_app.corr_config["input"] = corr_cfg["input"]
1969
+
1807
1970
  # Run epipolar matching application
1808
1971
  epipolar_disparity_map = self.dense_matching_app.run(
1809
1972
  new_epipolar_image_left,
@@ -1903,27 +2066,6 @@ class UnitPipeline(PipelineTemplate):
1903
2066
  if self.quit_on_app("dense_match_filling.2"):
1904
2067
  continue # keep iterating over pairs, but don't go further
1905
2068
 
1906
- if self.epsg is None:
1907
- # compute epsg
1908
- # Epsg uses global disparity min and max
1909
- self.epsg = preprocessing.compute_epsg(
1910
- self.pairs[pair_key]["sensor_image_left"],
1911
- self.pairs[pair_key]["sensor_image_right"],
1912
- self.pairs[pair_key]["corrected_grid_left"],
1913
- self.pairs[pair_key]["corrected_grid_right"],
1914
- self.geom_plugin_with_dem_and_geoid,
1915
- disp_min=self.pairs[pair_key]["disp_range_grid"][
1916
- "global_min"
1917
- ],
1918
- disp_max=self.pairs[pair_key]["disp_range_grid"][
1919
- "global_max"
1920
- ],
1921
- )
1922
- # Compute roi polygon, in input EPSG
1923
- self.roi_poly = preprocessing.compute_roi_poly(
1924
- self.input_roi_poly, self.input_roi_epsg, self.epsg
1925
- )
1926
-
1927
2069
  if isinstance(output[sens_cst.GEOID], str):
1928
2070
  output_geoid_path = output[sens_cst.GEOID]
1929
2071
  elif (
@@ -2119,60 +2261,6 @@ class UnitPipeline(PipelineTemplate):
2119
2261
  # keep iterating over pairs, but don't go further
2120
2262
  continue
2121
2263
 
2122
- if self.save_output_dsm or self.save_output_point_cloud:
2123
- # Compute terrain bounding box /roi related to
2124
- # current images
2125
- (current_terrain_roi_bbox, intersection_poly) = (
2126
- preprocessing.compute_terrain_bbox(
2127
- self.pairs[pair_key]["sensor_image_left"],
2128
- self.pairs[pair_key]["sensor_image_right"],
2129
- new_epipolar_image_left,
2130
- self.pairs[pair_key]["corrected_grid_left"],
2131
- self.pairs[pair_key]["corrected_grid_right"],
2132
- self.epsg,
2133
- self.geom_plugin_with_dem_and_geoid,
2134
- resolution=self.resolution,
2135
- disp_min=self.pairs[pair_key]["disp_range_grid"][
2136
- "global_min"
2137
- ],
2138
- disp_max=self.pairs[pair_key]["disp_range_grid"][
2139
- "global_max"
2140
- ],
2141
- roi_poly=(
2142
- None if self.debug_with_roi else self.roi_poly
2143
- ),
2144
- orchestrator=self.cars_orchestrator,
2145
- pair_key=pair_key,
2146
- pair_folder=os.path.join(
2147
- self.dump_dir, "terrain_bbox", pair_key
2148
- ),
2149
- check_inputs=False,
2150
- )
2151
- )
2152
- self.list_terrain_roi.append(current_terrain_roi_bbox)
2153
- self.list_intersection_poly.append(intersection_poly)
2154
-
2155
- # compute terrain bounds for later use
2156
- (
2157
- self.terrain_bounds,
2158
- self.optimal_terrain_tile_width,
2159
- ) = preprocessing.compute_terrain_bounds(
2160
- self.list_terrain_roi,
2161
- roi_poly=(None if self.debug_with_roi else self.roi_poly),
2162
- resolution=self.resolution,
2163
- )
2164
-
2165
- if self.which_resolution not in ("final", "single"):
2166
- if self.dem_generation_roi is not None:
2167
- # To get the correct size for the dem generation
2168
- self.terrain_bounds = (
2169
- dem_wrappers.modify_terrain_bounds(
2170
- self.dem_generation_roi,
2171
- self.epsg,
2172
- self.dem_generation_application.margin,
2173
- )
2174
- )
2175
-
2176
2264
  # quit if any app in the loop over the pairs was the last one
2177
2265
  # pylint:disable=too-many-boolean-expressions
2178
2266
  if (
@@ -2312,6 +2400,7 @@ class UnitPipeline(PipelineTemplate):
2312
2400
  _ = self.rasterization_application.run(
2313
2401
  self.point_cloud_to_rasterize,
2314
2402
  self.epsg,
2403
+ self.vertical_crs,
2315
2404
  resolution=self.resolution,
2316
2405
  orchestrator=self.cars_orchestrator,
2317
2406
  dsm_file_name=dsm_file_name,
@@ -2419,6 +2508,7 @@ class UnitPipeline(PipelineTemplate):
2419
2508
  sens_cst.DEM_PATH
2420
2509
  ]
2421
2510
  ),
2511
+ default_alt=self.geom_plugin_with_dem_and_geoid.default_alt,
2422
2512
  cars_orchestrator=self.cars_orchestrator,
2423
2513
  )
2424
2514
 
@@ -2549,6 +2639,7 @@ class UnitPipeline(PipelineTemplate):
2549
2639
  )
2550
2640
 
2551
2641
  self.epsg = rasterio_get_epsg(dict_path["dsm"][0])
2642
+ self.vertical_crs = rasterio_get_crs(dict_path["dsm"][0])
2552
2643
 
2553
2644
  # Compute roi polygon, in input EPSG
2554
2645
  self.roi_poly = preprocessing.compute_roi_poly(
@@ -2678,9 +2769,9 @@ class UnitPipeline(PipelineTemplate):
2678
2769
  )
2679
2770
 
2680
2771
  # Project polygon if epsg is different
2681
- if self.epsg != inter_epsg:
2682
- inter_poly = projection.polygon_projection(
2683
- inter_poly, inter_epsg, self.epsg
2772
+ if self.vertical_crs != CRS(inter_epsg):
2773
+ inter_poly = projection.polygon_projection_crs(
2774
+ inter_poly, CRS(inter_epsg), self.vertical_crs
2684
2775
  )
2685
2776
 
2686
2777
  self.list_intersection_poly.append(inter_poly)
@@ -2851,6 +2942,10 @@ class UnitPipeline(PipelineTemplate):
2851
2942
  if self.epsg is None:
2852
2943
  self.epsg = epsg_cloud
2853
2944
 
2945
+ self.vertical_crs = projection.get_output_crs(
2946
+ self.epsg, self.used_conf[OUTPUT]
2947
+ )
2948
+
2854
2949
  self.resolution = (
2855
2950
  self.used_conf[OUTPUT][out_cst.RESOLUTION] * self.res_resamp
2856
2951
  )
@@ -0,0 +1,2 @@
1
+ Version: 1.11.1
2
+ Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-0av8ij8b\\cp312-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-0av8ij8b\\cp312-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-0av8ij8b\\cp312-win_amd64\\built_wheel\\cars-1.0.0a3-cp312-cp312-win_amd64.whl']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cars
3
- Version: 1.0.0a2
3
+ Version: 1.0.0a3
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>