cars 1.0.0a1__cp313-cp313-win_amd64.whl → 1.0.0a2__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cars might be problematic. Click here for more details.
- cars/__init__.py +4 -4
- cars/applications/dem_generation/dem_generation_wrappers.py +5 -1
- cars/applications/dem_generation/dichotomic_generation_app.py +21 -6
- cars/applications/dem_generation/rasterization_app.py +70 -27
- cars/applications/dense_match_filling/abstract_dense_match_filling_app.py +4 -0
- cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp313-win_amd64.dll.a +0 -0
- cars/applications/dense_match_filling/cpp/dense_match_filling_cpp.cp313-win_amd64.pyd +0 -0
- cars/applications/dense_match_filling/fill_disp_algo.py +41 -12
- cars/applications/dense_match_filling/plane_app.py +11 -0
- cars/applications/dense_match_filling/zero_padding_app.py +11 -1
- cars/applications/dense_matching/census_mccnn_sgm_app.py +262 -545
- cars/applications/dense_matching/cpp/dense_matching_cpp.cp313-win_amd64.dll.a +0 -0
- cars/applications/dense_matching/cpp/dense_matching_cpp.cp313-win_amd64.pyd +0 -0
- cars/applications/dense_matching/dense_matching_algo.py +59 -11
- cars/applications/dense_matching/dense_matching_wrappers.py +51 -31
- cars/applications/dense_matching/disparity_grid_algo.py +572 -0
- cars/applications/grid_generation/grid_correction_app.py +0 -53
- cars/applications/grid_generation/transform_grid.py +5 -5
- cars/applications/point_cloud_fusion/pc_fusion_algo.py +17 -11
- cars/applications/point_cloud_fusion/pc_fusion_wrappers.py +3 -4
- cars/applications/rasterization/rasterization_algo.py +20 -27
- cars/applications/rasterization/rasterization_wrappers.py +6 -5
- cars/applications/rasterization/simple_gaussian_app.py +2 -14
- cars/applications/sparse_matching/sparse_matching_wrappers.py +0 -49
- cars/applications/triangulation/line_of_sight_intersection_app.py +1 -1
- cars/applications/triangulation/triangulation_wrappers.py +2 -1
- cars/bundleadjustment.py +51 -11
- cars/cars.py +15 -5
- cars/core/constants.py +1 -1
- cars/core/geometry/abstract_geometry.py +54 -11
- cars/core/geometry/shareloc_geometry.py +59 -14
- cars/orchestrator/registry/saver_registry.py +0 -78
- cars/pipelines/default/default_pipeline.py +23 -26
- cars/pipelines/parameters/depth_map_inputs.py +22 -67
- cars/pipelines/parameters/dsm_inputs.py +16 -29
- cars/pipelines/parameters/sensor_inputs.py +20 -21
- cars/pipelines/parameters/sensor_loaders/basic_sensor_loader.py +3 -3
- cars/pipelines/parameters/sensor_loaders/pivot_sensor_loader.py +2 -2
- cars/pipelines/parameters/sensor_loaders/sensor_loader.py +4 -6
- cars/pipelines/parameters/sensor_loaders/sensor_loader_template.py +2 -2
- cars/pipelines/pipeline.py +8 -8
- cars/pipelines/unit/unit_pipeline.py +103 -196
- cars/starter.py +20 -1
- cars-1.0.0a2.dist-info/DELVEWHEEL +2 -0
- {cars-1.0.0a1.dist-info → cars-1.0.0a2.dist-info}/METADATA +3 -2
- {cars-1.0.0a1.dist-info → cars-1.0.0a2.dist-info}/RECORD +48 -47
- cars-1.0.0a1.dist-info/DELVEWHEEL +0 -2
- {cars-1.0.0a1.dist-info → cars-1.0.0a2.dist-info}/WHEEL +0 -0
- {cars-1.0.0a1.dist-info → cars-1.0.0a2.dist-info}/entry_points.txt +0 -0
|
@@ -94,7 +94,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
94
94
|
|
|
95
95
|
# pylint: disable=too-many-instance-attributes
|
|
96
96
|
|
|
97
|
-
def __init__(self, conf,
|
|
97
|
+
def __init__(self, conf, config_dir=None): # noqa: C901
|
|
98
98
|
"""
|
|
99
99
|
Creates pipeline
|
|
100
100
|
|
|
@@ -113,13 +113,17 @@ class UnitPipeline(PipelineTemplate):
|
|
|
113
113
|
:type pipeline_name: str
|
|
114
114
|
:param cfg: configuration {'matching_cost_method': value}
|
|
115
115
|
:type cfg: dictionary
|
|
116
|
-
:param
|
|
117
|
-
:type
|
|
116
|
+
:param config_dir: path to dir containing json/yaml
|
|
117
|
+
:type config_dir: str
|
|
118
118
|
"""
|
|
119
119
|
|
|
120
120
|
# Used conf
|
|
121
121
|
self.used_conf = {}
|
|
122
122
|
|
|
123
|
+
# Transform relative path to absolute path
|
|
124
|
+
if config_dir is not None:
|
|
125
|
+
config_dir = os.path.abspath(config_dir)
|
|
126
|
+
|
|
123
127
|
# Check global conf
|
|
124
128
|
self.check_global_schema(conf)
|
|
125
129
|
|
|
@@ -129,9 +133,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
129
133
|
)
|
|
130
134
|
|
|
131
135
|
# Check conf inputs
|
|
132
|
-
inputs = self.check_inputs(
|
|
133
|
-
conf[INPUTS], config_json_dir=config_json_dir
|
|
134
|
-
)
|
|
136
|
+
inputs = self.check_inputs(conf[INPUTS], config_dir=config_dir)
|
|
135
137
|
self.used_conf[INPUTS] = inputs
|
|
136
138
|
|
|
137
139
|
# Check advanced parameters
|
|
@@ -419,15 +421,15 @@ class UnitPipeline(PipelineTemplate):
|
|
|
419
421
|
logging.warning(log_msg)
|
|
420
422
|
|
|
421
423
|
@staticmethod
|
|
422
|
-
def check_inputs(conf,
|
|
424
|
+
def check_inputs(conf, config_dir=None):
|
|
423
425
|
"""
|
|
424
426
|
Check the inputs given
|
|
425
427
|
|
|
426
428
|
:param conf: configuration of inputs
|
|
427
429
|
:type conf: dict
|
|
428
|
-
:param
|
|
430
|
+
:param config_dir: directory of used json/yaml, if
|
|
429
431
|
user filled paths with relative paths
|
|
430
|
-
:type
|
|
432
|
+
:type config_dir: str
|
|
431
433
|
|
|
432
434
|
:return: overloaded inputs
|
|
433
435
|
:rtype: dict
|
|
@@ -440,21 +442,19 @@ class UnitPipeline(PipelineTemplate):
|
|
|
440
442
|
and dsm_cst.DSMS not in conf
|
|
441
443
|
):
|
|
442
444
|
output_config = sensor_inputs.sensors_check_inputs(
|
|
443
|
-
conf,
|
|
445
|
+
conf, config_dir=config_dir
|
|
444
446
|
)
|
|
445
447
|
elif depth_cst.DEPTH_MAPS in conf:
|
|
446
448
|
output_config = {
|
|
447
449
|
**output_config,
|
|
448
450
|
**depth_map_inputs.check_depth_maps_inputs(
|
|
449
|
-
conf,
|
|
451
|
+
conf, config_dir=config_dir
|
|
450
452
|
),
|
|
451
453
|
}
|
|
452
454
|
else:
|
|
453
455
|
output_config = {
|
|
454
456
|
**output_config,
|
|
455
|
-
**dsm_inputs.check_dsm_inputs(
|
|
456
|
-
conf, config_json_dir=config_json_dir
|
|
457
|
-
),
|
|
457
|
+
**dsm_inputs.check_dsm_inputs(conf, config_dir=config_dir),
|
|
458
458
|
}
|
|
459
459
|
return output_config
|
|
460
460
|
|
|
@@ -1185,15 +1185,11 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1185
1185
|
(
|
|
1186
1186
|
self.pairs[pair_key]["grid_correction_coef"],
|
|
1187
1187
|
self.pairs[pair_key]["corrected_matches_array"],
|
|
1188
|
-
self.pairs[pair_key]["corrected_matches_cars_ds"],
|
|
1189
1188
|
_,
|
|
1190
1189
|
_,
|
|
1191
1190
|
) = grid_correction_app.estimate_right_grid_correction(
|
|
1192
1191
|
self.pairs[pair_key]["matches_array"],
|
|
1193
1192
|
self.pairs[pair_key]["grid_right"],
|
|
1194
|
-
initial_cars_ds=self.pairs[pair_key][
|
|
1195
|
-
"epipolar_matches_left"
|
|
1196
|
-
],
|
|
1197
1193
|
save_matches=save_matches,
|
|
1198
1194
|
minimum_nb_matches=minimum_nb_matches,
|
|
1199
1195
|
pair_folder=os.path.join(
|
|
@@ -1255,6 +1251,19 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1255
1251
|
"Global disparity interval with margin : "
|
|
1256
1252
|
f"[{disp_min:.2f} pix, {disp_max:.2f} pix]"
|
|
1257
1253
|
)
|
|
1254
|
+
else:
|
|
1255
|
+
disp_min = (
|
|
1256
|
+
-self.sparse_mtch_sift_app.elevation_delta_upper_bound
|
|
1257
|
+
/ disp_to_alt_ratio
|
|
1258
|
+
)
|
|
1259
|
+
disp_max = (
|
|
1260
|
+
-self.sparse_mtch_sift_app.elevation_delta_lower_bound
|
|
1261
|
+
/ disp_to_alt_ratio
|
|
1262
|
+
)
|
|
1263
|
+
logging.info(
|
|
1264
|
+
"Global disparity interval : "
|
|
1265
|
+
f"[{disp_min:.2f} pix, {disp_max:.2f} pix]"
|
|
1266
|
+
)
|
|
1258
1267
|
|
|
1259
1268
|
if self.epsg is None:
|
|
1260
1269
|
# compute epsg
|
|
@@ -1293,7 +1302,6 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1293
1302
|
or self.quit_on_app("resampling")
|
|
1294
1303
|
or self.quit_on_app("hole_detection")
|
|
1295
1304
|
or self.quit_on_app("sparse_matching.sift")
|
|
1296
|
-
or self.quit_on_app("sparse_matching.pandora")
|
|
1297
1305
|
):
|
|
1298
1306
|
return True
|
|
1299
1307
|
|
|
@@ -1356,13 +1364,12 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1356
1364
|
pair_name for pair_name, _, _ in self.list_sensor_pairs
|
|
1357
1365
|
]
|
|
1358
1366
|
|
|
1359
|
-
for
|
|
1367
|
+
for _, (pair_key, _, _) in enumerate(self.list_sensor_pairs):
|
|
1360
1368
|
# Geometry plugin with dem will be used for the grid generation
|
|
1361
1369
|
geom_plugin = self.geom_plugin_with_dem_and_geoid
|
|
1362
1370
|
|
|
1363
1371
|
if self.used_conf[ADVANCED][adv_cst.USE_EPIPOLAR_A_PRIORI] is False:
|
|
1364
|
-
|
|
1365
|
-
save_matches = True
|
|
1372
|
+
save_matches = True
|
|
1366
1373
|
|
|
1367
1374
|
(
|
|
1368
1375
|
self.pairs[pair_key]["sensor_matches_left"],
|
|
@@ -1376,97 +1383,6 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1376
1383
|
),
|
|
1377
1384
|
save_matches=save_matches,
|
|
1378
1385
|
)
|
|
1379
|
-
|
|
1380
|
-
# saved used
|
|
1381
|
-
|
|
1382
|
-
if (
|
|
1383
|
-
inputs[sens_cst.INITIAL_ELEVATION][sens_cst.DEM_PATH]
|
|
1384
|
-
is None
|
|
1385
|
-
# cover the case where the geom plugin doesn't use init elev
|
|
1386
|
-
or (
|
|
1387
|
-
inputs[sens_cst.INITIAL_ELEVATION][sens_cst.DEM_PATH]
|
|
1388
|
-
!= geom_plugin.dem
|
|
1389
|
-
)
|
|
1390
|
-
):
|
|
1391
|
-
# Generate grids with new MNT
|
|
1392
|
-
(
|
|
1393
|
-
self.pairs[pair_key]["new_grid_left"],
|
|
1394
|
-
self.pairs[pair_key]["new_grid_right"],
|
|
1395
|
-
) = self.epipolar_grid_generation_application.run(
|
|
1396
|
-
self.pairs[pair_key]["sensor_image_left"],
|
|
1397
|
-
self.pairs[pair_key]["sensor_image_right"],
|
|
1398
|
-
geom_plugin,
|
|
1399
|
-
orchestrator=self.cars_orchestrator,
|
|
1400
|
-
pair_folder=os.path.join(
|
|
1401
|
-
self.dump_dir,
|
|
1402
|
-
"epipolar_grid_generation",
|
|
1403
|
-
"new_mnt",
|
|
1404
|
-
pair_key,
|
|
1405
|
-
),
|
|
1406
|
-
pair_key=pair_key,
|
|
1407
|
-
)
|
|
1408
|
-
|
|
1409
|
-
# Correct grids with former matches
|
|
1410
|
-
# Transform matches to new grids
|
|
1411
|
-
|
|
1412
|
-
save_matches = self.sparse_mtch_sift_app.get_save_matches()
|
|
1413
|
-
|
|
1414
|
-
new_grid_matches_array = (
|
|
1415
|
-
geom_plugin.transform_matches_from_grids(
|
|
1416
|
-
self.pairs[pair_key]["sensor_matches_left"],
|
|
1417
|
-
self.pairs[pair_key]["sensor_matches_right"],
|
|
1418
|
-
self.pairs[pair_key]["new_grid_left"],
|
|
1419
|
-
self.pairs[pair_key]["new_grid_right"],
|
|
1420
|
-
)
|
|
1421
|
-
)
|
|
1422
|
-
|
|
1423
|
-
# Estimate grid_correction
|
|
1424
|
-
(
|
|
1425
|
-
self.pairs[pair_key]["grid_correction_coef"],
|
|
1426
|
-
self.pairs[pair_key]["corrected_matches_array"],
|
|
1427
|
-
self.pairs[pair_key]["corrected_matches_cars_ds"],
|
|
1428
|
-
_,
|
|
1429
|
-
_,
|
|
1430
|
-
) = grid_correction_app.estimate_right_grid_correction(
|
|
1431
|
-
new_grid_matches_array,
|
|
1432
|
-
self.pairs[pair_key]["new_grid_right"],
|
|
1433
|
-
save_matches=save_matches,
|
|
1434
|
-
minimum_nb_matches=minimum_nb_matches,
|
|
1435
|
-
initial_cars_ds=self.pairs[pair_key][
|
|
1436
|
-
"epipolar_matches_left"
|
|
1437
|
-
],
|
|
1438
|
-
pair_folder=os.path.join(
|
|
1439
|
-
self.dump_dir, "grid_correction", "new", pair_key
|
|
1440
|
-
),
|
|
1441
|
-
pair_key=pair_key,
|
|
1442
|
-
orchestrator=self.cars_orchestrator,
|
|
1443
|
-
)
|
|
1444
|
-
|
|
1445
|
-
# Correct grid right
|
|
1446
|
-
|
|
1447
|
-
self.pairs[pair_key]["corrected_grid_right"] = (
|
|
1448
|
-
grid_correction_app.correct_grid(
|
|
1449
|
-
self.pairs[pair_key]["new_grid_right"],
|
|
1450
|
-
self.pairs[pair_key]["grid_correction_coef"],
|
|
1451
|
-
os.path.join(
|
|
1452
|
-
self.dump_dir,
|
|
1453
|
-
"grid_correction",
|
|
1454
|
-
"new",
|
|
1455
|
-
pair_key,
|
|
1456
|
-
),
|
|
1457
|
-
save_corrected_grid,
|
|
1458
|
-
)
|
|
1459
|
-
)
|
|
1460
|
-
|
|
1461
|
-
# Use the new grid as uncorrected grid
|
|
1462
|
-
self.pairs[pair_key]["grid_right"] = self.pairs[pair_key][
|
|
1463
|
-
"new_grid_right"
|
|
1464
|
-
]
|
|
1465
|
-
|
|
1466
|
-
self.pairs[pair_key]["corrected_grid_left"] = self.pairs[
|
|
1467
|
-
pair_key
|
|
1468
|
-
]["new_grid_left"]
|
|
1469
|
-
|
|
1470
1386
|
elif (
|
|
1471
1387
|
self.used_conf[ADVANCED][adv_cst.USE_EPIPOLAR_A_PRIORI] is True
|
|
1472
1388
|
and not self.use_sift_a_priori
|
|
@@ -1553,14 +1469,12 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1553
1469
|
(
|
|
1554
1470
|
self.pairs[pair_key]["grid_correction_coef"],
|
|
1555
1471
|
self.pairs[pair_key]["corrected_matches_array"],
|
|
1556
|
-
self.pairs[pair_key]["corrected_matches_cars_ds"],
|
|
1557
1472
|
_,
|
|
1558
1473
|
_,
|
|
1559
1474
|
) = grid_correction_app.estimate_right_grid_correction(
|
|
1560
1475
|
new_grid_matches_array,
|
|
1561
1476
|
self.pairs[pair_key]["grid_right"],
|
|
1562
1477
|
save_matches=save_matches,
|
|
1563
|
-
initial_cars_ds=None,
|
|
1564
1478
|
pair_folder=os.path.join(
|
|
1565
1479
|
self.dump_dir, "grid_correction", "new", pair_key
|
|
1566
1480
|
),
|
|
@@ -1638,8 +1552,8 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1638
1552
|
):
|
|
1639
1553
|
dmin = disp_min / self.res_resamp
|
|
1640
1554
|
dmax = disp_max / self.res_resamp
|
|
1641
|
-
|
|
1642
|
-
disp_range_grid = (
|
|
1555
|
+
# generate_disparity_grids runs orchestrator.breakpoint()
|
|
1556
|
+
self.pairs[pair_key]["disp_range_grid"] = (
|
|
1643
1557
|
self.dense_matching_app.generate_disparity_grids(
|
|
1644
1558
|
self.pairs[pair_key]["sensor_image_right"],
|
|
1645
1559
|
self.pairs[pair_key]["corrected_grid_right"],
|
|
@@ -1647,7 +1561,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1647
1561
|
dmin=dmin,
|
|
1648
1562
|
dmax=dmax,
|
|
1649
1563
|
pair_folder=dense_matching_pair_folder,
|
|
1650
|
-
|
|
1564
|
+
orchestrator=self.cars_orchestrator,
|
|
1651
1565
|
)
|
|
1652
1566
|
)
|
|
1653
1567
|
|
|
@@ -1674,8 +1588,8 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1674
1588
|
else:
|
|
1675
1589
|
if None in (altitude_delta_min, altitude_delta_max):
|
|
1676
1590
|
# Generate min and max disp grids from dems
|
|
1677
|
-
|
|
1678
|
-
disp_range_grid = (
|
|
1591
|
+
# generate_disparity_grids runs orchestrator.breakpoint()
|
|
1592
|
+
self.pairs[pair_key]["disp_range_grid"] = (
|
|
1679
1593
|
self.dense_matching_app.generate_disparity_grids(
|
|
1680
1594
|
self.pairs[pair_key]["sensor_image_right"],
|
|
1681
1595
|
self.pairs[pair_key]["corrected_grid_right"],
|
|
@@ -1684,12 +1598,13 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1684
1598
|
dem_max=dem_max,
|
|
1685
1599
|
dem_median=dem_median,
|
|
1686
1600
|
pair_folder=dense_matching_pair_folder,
|
|
1687
|
-
|
|
1601
|
+
orchestrator=self.cars_orchestrator,
|
|
1688
1602
|
)
|
|
1689
1603
|
)
|
|
1690
1604
|
else:
|
|
1691
1605
|
# Generate min and max disp grids from deltas
|
|
1692
|
-
|
|
1606
|
+
# generate_disparity_grids runs orchestrator.breakpoint()
|
|
1607
|
+
self.pairs[pair_key]["disp_range_grid"] = (
|
|
1693
1608
|
self.dense_matching_app.generate_disparity_grids(
|
|
1694
1609
|
self.pairs[pair_key]["sensor_image_right"],
|
|
1695
1610
|
self.pairs[pair_key]["corrected_grid_right"],
|
|
@@ -1698,7 +1613,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1698
1613
|
altitude_delta_max=altitude_delta_max,
|
|
1699
1614
|
dem_median=dem_median,
|
|
1700
1615
|
pair_folder=dense_matching_pair_folder,
|
|
1701
|
-
|
|
1616
|
+
orchestrator=self.cars_orchestrator,
|
|
1702
1617
|
)
|
|
1703
1618
|
)
|
|
1704
1619
|
|
|
@@ -1708,12 +1623,12 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1708
1623
|
# TODO remove when only local diparity range will be used
|
|
1709
1624
|
|
|
1710
1625
|
if self.use_sift_a_priori:
|
|
1711
|
-
dmin =
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
dmax =
|
|
1715
|
-
|
|
1716
|
-
|
|
1626
|
+
dmin = self.pairs[pair_key]["disp_range_grid"][
|
|
1627
|
+
"global_min"
|
|
1628
|
+
]
|
|
1629
|
+
dmax = self.pairs[pair_key]["disp_range_grid"][
|
|
1630
|
+
"global_max"
|
|
1631
|
+
]
|
|
1717
1632
|
|
|
1718
1633
|
# update orchestrator_out_json
|
|
1719
1634
|
marg = self.sparse_mtch_sift_app.get_disparity_margin()
|
|
@@ -1737,7 +1652,8 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1737
1652
|
pair_key=pair_key,
|
|
1738
1653
|
)
|
|
1739
1654
|
|
|
1740
|
-
|
|
1655
|
+
# generate_disparity_grids runs orchestrator.breakpoint()
|
|
1656
|
+
self.pairs[pair_key]["disp_range_grid"] = (
|
|
1741
1657
|
self.dense_matching_app.generate_disparity_grids(
|
|
1742
1658
|
self.pairs[pair_key]["sensor_image_right"],
|
|
1743
1659
|
self.pairs[pair_key]["corrected_grid_right"],
|
|
@@ -1745,34 +1661,23 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1745
1661
|
dmin=dmin,
|
|
1746
1662
|
dmax=dmax,
|
|
1747
1663
|
pair_folder=dense_matching_pair_folder,
|
|
1748
|
-
|
|
1664
|
+
orchestrator=self.cars_orchestrator,
|
|
1749
1665
|
)
|
|
1750
1666
|
)
|
|
1751
|
-
# Get margins used in dense matching,
|
|
1752
|
-
dense_matching_margins_fun = (
|
|
1753
|
-
self.dense_matching_app.get_margins_fun(
|
|
1754
|
-
self.pairs[pair_key]["corrected_grid_left"],
|
|
1755
|
-
disp_range_grid,
|
|
1756
|
-
)
|
|
1757
|
-
)
|
|
1758
1667
|
|
|
1759
1668
|
# TODO add in metadata.json max diff max - min
|
|
1760
1669
|
# Update used_conf configuration with epipolar a priori
|
|
1761
1670
|
# Add global min and max computed with grids
|
|
1762
1671
|
advanced_parameters.update_conf(
|
|
1763
1672
|
self.used_conf,
|
|
1764
|
-
dmin=
|
|
1765
|
-
|
|
1766
|
-
), # TODO compute dmin dans dmax
|
|
1767
|
-
dmax=np.max(disp_range_grid[0, 0]["disp_max_grid"].values),
|
|
1673
|
+
dmin=self.pairs[pair_key]["disp_range_grid"]["global_min"],
|
|
1674
|
+
dmax=self.pairs[pair_key]["disp_range_grid"]["global_max"],
|
|
1768
1675
|
pair_key=pair_key,
|
|
1769
1676
|
)
|
|
1770
1677
|
advanced_parameters.update_conf(
|
|
1771
1678
|
self.config_full_res,
|
|
1772
|
-
dmin=
|
|
1773
|
-
|
|
1774
|
-
), # TODO compute dmin dans dmax
|
|
1775
|
-
dmax=np.max(disp_range_grid[0, 0]["disp_max_grid"].values),
|
|
1679
|
+
dmin=self.pairs[pair_key]["disp_range_grid"]["global_min"],
|
|
1680
|
+
dmax=self.pairs[pair_key]["disp_range_grid"]["global_max"],
|
|
1776
1681
|
pair_key=pair_key,
|
|
1777
1682
|
)
|
|
1778
1683
|
|
|
@@ -1783,6 +1688,10 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1783
1688
|
safe_save=True,
|
|
1784
1689
|
)
|
|
1785
1690
|
|
|
1691
|
+
# end of for loop, to finish computing disparity range grids
|
|
1692
|
+
|
|
1693
|
+
for cloud_id, (pair_key, _, _) in enumerate(self.list_sensor_pairs):
|
|
1694
|
+
|
|
1786
1695
|
# Generate roi
|
|
1787
1696
|
epipolar_roi = preprocessing.compute_epipolar_roi(
|
|
1788
1697
|
self.input_roi_poly,
|
|
@@ -1793,10 +1702,8 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1793
1702
|
self.pairs[pair_key]["corrected_grid_left"],
|
|
1794
1703
|
self.pairs[pair_key]["corrected_grid_right"],
|
|
1795
1704
|
os.path.join(self.dump_dir, "compute_epipolar_roi", pair_key),
|
|
1796
|
-
disp_min=
|
|
1797
|
-
|
|
1798
|
-
), # TODO compute dmin dans dmax
|
|
1799
|
-
disp_max=np.max(disp_range_grid[0, 0]["disp_max_grid"].values),
|
|
1705
|
+
disp_min=self.pairs[pair_key]["disp_range_grid"]["global_min"],
|
|
1706
|
+
disp_max=self.pairs[pair_key]["disp_range_grid"]["global_max"],
|
|
1800
1707
|
)
|
|
1801
1708
|
|
|
1802
1709
|
# Generate new epipolar images
|
|
@@ -1808,7 +1715,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1808
1715
|
optimum_tile_size,
|
|
1809
1716
|
local_tile_optimal_size_fun,
|
|
1810
1717
|
) = self.dense_matching_app.get_optimal_tile_size(
|
|
1811
|
-
disp_range_grid,
|
|
1718
|
+
self.pairs[pair_key]["disp_range_grid"],
|
|
1812
1719
|
self.cars_orchestrator.cluster.checked_conf_cluster[
|
|
1813
1720
|
"max_ram_per_worker"
|
|
1814
1721
|
],
|
|
@@ -1828,6 +1735,14 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1828
1735
|
for band in self.texture_bands
|
|
1829
1736
|
]
|
|
1830
1737
|
|
|
1738
|
+
# Get margins used in dense matching,
|
|
1739
|
+
dense_matching_margins_fun = (
|
|
1740
|
+
self.dense_matching_app.get_margins_fun(
|
|
1741
|
+
self.pairs[pair_key]["corrected_grid_left"],
|
|
1742
|
+
self.pairs[pair_key]["disp_range_grid"],
|
|
1743
|
+
)
|
|
1744
|
+
)
|
|
1745
|
+
|
|
1831
1746
|
# Run third epipolar resampling
|
|
1832
1747
|
(
|
|
1833
1748
|
new_epipolar_image_left,
|
|
@@ -1899,7 +1814,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1899
1814
|
self.dump_dir, "dense_matching", pair_key
|
|
1900
1815
|
),
|
|
1901
1816
|
pair_key=pair_key,
|
|
1902
|
-
disp_range_grid=disp_range_grid,
|
|
1817
|
+
disp_range_grid=self.pairs[pair_key]["disp_range_grid"],
|
|
1903
1818
|
compute_disparity_masks=False,
|
|
1904
1819
|
margins_to_keep=(
|
|
1905
1820
|
self.pc_outlier_removal_1_app.get_epipolar_margin()
|
|
@@ -1919,11 +1834,13 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1919
1834
|
epipolar_disparity_map,
|
|
1920
1835
|
self.pairs[pair_key]["holes_bbox_left"],
|
|
1921
1836
|
self.pairs[pair_key]["holes_bbox_right"],
|
|
1922
|
-
disp_min=
|
|
1923
|
-
|
|
1924
|
-
|
|
1837
|
+
disp_min=self.pairs[pair_key]["disp_range_grid"][
|
|
1838
|
+
"global_min"
|
|
1839
|
+
],
|
|
1925
1840
|
disp_max=np.max(
|
|
1926
|
-
|
|
1841
|
+
self.pairs[pair_key]["disp_range_grid"][
|
|
1842
|
+
"global_max"
|
|
1843
|
+
]
|
|
1927
1844
|
),
|
|
1928
1845
|
orchestrator=self.cars_orchestrator,
|
|
1929
1846
|
pair_folder=os.path.join(
|
|
@@ -1955,11 +1872,13 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1955
1872
|
filled_with_1_epipolar_disparity_map,
|
|
1956
1873
|
self.pairs[pair_key]["holes_bbox_left"],
|
|
1957
1874
|
self.pairs[pair_key]["holes_bbox_right"],
|
|
1958
|
-
disp_min=
|
|
1959
|
-
|
|
1960
|
-
|
|
1875
|
+
disp_min=self.pairs[pair_key]["disp_range_grid"][
|
|
1876
|
+
"global_min"
|
|
1877
|
+
],
|
|
1961
1878
|
disp_max=np.max(
|
|
1962
|
-
|
|
1879
|
+
self.pairs[pair_key]["disp_range_grid"][
|
|
1880
|
+
"global_max"
|
|
1881
|
+
]
|
|
1963
1882
|
),
|
|
1964
1883
|
orchestrator=self.cars_orchestrator,
|
|
1965
1884
|
pair_folder=os.path.join(
|
|
@@ -1993,12 +1912,12 @@ class UnitPipeline(PipelineTemplate):
|
|
|
1993
1912
|
self.pairs[pair_key]["corrected_grid_left"],
|
|
1994
1913
|
self.pairs[pair_key]["corrected_grid_right"],
|
|
1995
1914
|
self.geom_plugin_with_dem_and_geoid,
|
|
1996
|
-
disp_min=
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
disp_max=
|
|
2000
|
-
|
|
2001
|
-
|
|
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
|
+
],
|
|
2002
1921
|
)
|
|
2003
1922
|
# Compute roi polygon, in input EPSG
|
|
2004
1923
|
self.roi_poly = preprocessing.compute_roi_poly(
|
|
@@ -2213,12 +2132,12 @@ class UnitPipeline(PipelineTemplate):
|
|
|
2213
2132
|
self.epsg,
|
|
2214
2133
|
self.geom_plugin_with_dem_and_geoid,
|
|
2215
2134
|
resolution=self.resolution,
|
|
2216
|
-
disp_min=
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
disp_max=
|
|
2220
|
-
|
|
2221
|
-
|
|
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
|
+
],
|
|
2222
2141
|
roi_poly=(
|
|
2223
2142
|
None if self.debug_with_roi else self.roi_poly
|
|
2224
2143
|
),
|
|
@@ -2244,12 +2163,15 @@ class UnitPipeline(PipelineTemplate):
|
|
|
2244
2163
|
)
|
|
2245
2164
|
|
|
2246
2165
|
if self.which_resolution not in ("final", "single"):
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
self.
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
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
|
+
)
|
|
2253
2175
|
|
|
2254
2176
|
# quit if any app in the loop over the pairs was the last one
|
|
2255
2177
|
# pylint:disable=too-many-boolean-expressions
|
|
@@ -2488,9 +2410,10 @@ class UnitPipeline(PipelineTemplate):
|
|
|
2488
2410
|
dem_min_file_name,
|
|
2489
2411
|
dem_max_file_name,
|
|
2490
2412
|
dem_median_file_name,
|
|
2491
|
-
self.used_conf[INPUTS][sens_cst.INITIAL_ELEVATION][
|
|
2413
|
+
input_geoid=self.used_conf[INPUTS][sens_cst.INITIAL_ELEVATION][
|
|
2492
2414
|
sens_cst.GEOID
|
|
2493
2415
|
],
|
|
2416
|
+
output_geoid=self.used_conf[OUTPUT][out_cst.OUT_GEOID],
|
|
2494
2417
|
initial_elevation=(
|
|
2495
2418
|
self.used_conf[INPUTS][sens_cst.INITIAL_ELEVATION][
|
|
2496
2419
|
sens_cst.DEM_PATH
|
|
@@ -2539,7 +2462,7 @@ class UnitPipeline(PipelineTemplate):
|
|
|
2539
2462
|
for key in dsm_dict.keys():
|
|
2540
2463
|
for path_name in dsm_dict[key].keys():
|
|
2541
2464
|
if dsm_dict[key][path_name] is not None:
|
|
2542
|
-
if
|
|
2465
|
+
if isinstance(dsm_dict[key][path_name], str):
|
|
2543
2466
|
if path_name not in dict_path:
|
|
2544
2467
|
dict_path[path_name] = [
|
|
2545
2468
|
dsm_dict[key][path_name]
|
|
@@ -2548,22 +2471,6 @@ class UnitPipeline(PipelineTemplate):
|
|
|
2548
2471
|
dict_path[path_name].append(
|
|
2549
2472
|
dsm_dict[key][path_name]
|
|
2550
2473
|
)
|
|
2551
|
-
else:
|
|
2552
|
-
for confidence_path_name in dsm_dict[key][
|
|
2553
|
-
path_name
|
|
2554
|
-
].keys():
|
|
2555
|
-
if confidence_path_name not in dict_path:
|
|
2556
|
-
dict_path[confidence_path_name] = [
|
|
2557
|
-
dsm_dict[key][path_name][
|
|
2558
|
-
confidence_path_name
|
|
2559
|
-
]
|
|
2560
|
-
]
|
|
2561
|
-
else:
|
|
2562
|
-
dict_path[confidence_path_name].append(
|
|
2563
|
-
dsm_dict[key][path_name][
|
|
2564
|
-
confidence_path_name
|
|
2565
|
-
]
|
|
2566
|
-
)
|
|
2567
2474
|
|
|
2568
2475
|
color_file_name = (
|
|
2569
2476
|
os.path.join(
|
cars/starter.py
CHANGED
|
@@ -28,6 +28,8 @@ import argparse
|
|
|
28
28
|
import json
|
|
29
29
|
import os
|
|
30
30
|
|
|
31
|
+
import yaml
|
|
32
|
+
|
|
31
33
|
|
|
32
34
|
def inputfilename_to_sensor(inputfilename):
|
|
33
35
|
"""
|
|
@@ -106,7 +108,16 @@ def cars_starter(cli_params: dict = None, **kwargs) -> None:
|
|
|
106
108
|
if full:
|
|
107
109
|
cars_config = used_pipeline.used_conf
|
|
108
110
|
|
|
109
|
-
|
|
111
|
+
# output format handling
|
|
112
|
+
output_format = config.get("format", "yaml")
|
|
113
|
+
if output_format == "yaml":
|
|
114
|
+
print(yaml.safe_dump(cars_config, sort_keys=False))
|
|
115
|
+
elif output_format == "json":
|
|
116
|
+
print(json.dumps(cars_config, indent=2))
|
|
117
|
+
else:
|
|
118
|
+
raise ValueError(
|
|
119
|
+
"Invalid format: {}. Use 'json' or 'yaml'.".format(output_format)
|
|
120
|
+
)
|
|
110
121
|
|
|
111
122
|
|
|
112
123
|
def cli():
|
|
@@ -139,6 +150,14 @@ def cli():
|
|
|
139
150
|
|
|
140
151
|
parser.add_argument("--check", action="store_true", help="Check inputs")
|
|
141
152
|
|
|
153
|
+
parser.add_argument(
|
|
154
|
+
"--format",
|
|
155
|
+
type=str,
|
|
156
|
+
default="yaml",
|
|
157
|
+
choices=["json", "yaml"],
|
|
158
|
+
help="Output format (json or yaml). Default: yaml",
|
|
159
|
+
)
|
|
160
|
+
|
|
142
161
|
args = parser.parse_args()
|
|
143
162
|
cars_starter(vars(args))
|
|
144
163
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Version: 1.11.1
|
|
2
|
+
Arguments: ['C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-wdv5mdb7\\cp313-win_amd64\\build\\venv\\Scripts\\delvewheel', 'repair', '-w', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-wdv5mdb7\\cp313-win_amd64\\repaired_wheel', 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-wdv5mdb7\\cp313-win_amd64\\built_wheel\\cars-1.0.0a2-cp313-cp313-win_amd64.whl']
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cars
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0a2
|
|
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>
|
|
@@ -26,6 +26,7 @@ Requires-Dist: dask>=2021.10.0
|
|
|
26
26
|
Requires-Dist: distributed>=2021.10.0
|
|
27
27
|
Requires-Dist: dask-jobqueue>=0.7.3
|
|
28
28
|
Requires-Dist: json-checker
|
|
29
|
+
Requires-Dist: pyyaml
|
|
29
30
|
Requires-Dist: xarray
|
|
30
31
|
Requires-Dist: tqdm
|
|
31
32
|
Requires-Dist: netCDF4>=1.5.3
|
|
@@ -43,7 +44,7 @@ Requires-Dist: cars-rasterize==0.2.*
|
|
|
43
44
|
Requires-Dist: cars-resample==0.1.*
|
|
44
45
|
Requires-Dist: cars-filter==0.2.*
|
|
45
46
|
Requires-Dist: vlsift==0.1.*
|
|
46
|
-
Requires-Dist: shareloc==0.2.
|
|
47
|
+
Requires-Dist: shareloc==0.2.9
|
|
47
48
|
Requires-Dist: bulldozer-dtm==1.1.*
|
|
48
49
|
Requires-Dist: xdem==0.1.*
|
|
49
50
|
Requires-Dist: geopandas<=1.0.1
|