FAQ
How do I use a step parameter in the matching cost computation?
A notebook showing the use of the step parameter and Region Of Interest (ROI) is available
It is possible to add a step parameter in the configuration file. This parameter ensures that not all pixels are calculated during the matching cost computation.
user_cfg = {
"input": {
"left": {
"img": img_left_path,
"nodata": "NaN",
},
"right": {
"img": img_right_path,
"nodata": "NaN",
},
"col_disparity": {"init": 0, "range": 3},
"row_disparity": {"init": 0, "range": 3},
},
"pipeline": {
"matching_cost": {
"matching_cost_method": "zncc",
"window_size": 7,
"step": [5, 5],
},
"disparity": {
"disparity_method": "wta",
"invalid_disparity": -9999,
},
"refinement": {
"refinement_method": "dichotomy", "filter": {"method": "bicubic"}, "iterations" : 2},
}
},
"output": {
"path": "step_output"
}
}
How do I choose to process only a certain part of the image?
A notebook showing the use of the step parameter and Region Of Interest (ROI) is available
It is possible to work on only one section of the image with an ROI. For this, the user can specify the area he wants in the configuration file.
user_cfg = {
"input": {
"left": {
"img": img_left_path,
"nodata": "NaN",
},
"right": {
"img": img_right_path,
"nodata": "NaN",
},
"col_disparity": {"init": 0, "range": 3},
"row_disparity": {"init": 0, "range": 3},
},
"ROI": {
"col": {"first": 10, "last": 100},
"row": {"first": 10, "last": 100},
},
"pipeline": {
"matching_cost": {
"matching_cost_method": "zncc",
"window_size": 7,
"step": [5, 5],
},
"disparity": {
"disparity_method": "wta",
"invalid_disparity": -9999,
},
"refinement": {
"refinement_method": "dichotomy",
"filter": {"method": "bicubic"},
"iterations" : 2
}
},
"output": {
"path": "roi_output"
}
}
user_cfg["ROI"]["margins"] = pandora2d_machine.global_margins.astuple()
roi = get_roi_processing(user_cfg["ROI"], user_cfg["input"]["col_disparity"], user_cfg["input"]["row_disparity"])
image_datasets = create_datasets_from_inputs(input_config=user_cfg["input"], roi=roi, estimation_cfg=user_cfg["pipeline"].get("estimation"))
Note
When the usage_step_roi_config.ipynb notebook is run, disparity maps are displayed. Margins can be present on these disparity maps, which is why they may be larger than the ROI given by the user. To remove these margins and display only the user ROI, you can use the pandora2d.img_tools.remove_roi_margins() method.
On which target platforms are wheels produced?
Wheel production is carried out using cibuildwheel. See here for possible target platforms. However, a number of platforms have been removed from the list, such as:
32-bit platforms: SciPy is not available on them, and it is a necessary dependency for subpix input and multiscale.
musllinux: The rasterio library is not available on it, and it is a necessary dependency for the execution of pandora.
macOs: Wheel construction is impossible at the moment.
pypy : An internal decision was made not to support it.
How do I add a no data value to the metadata of a tif file that I want to use as an initial disparity grid?
When using an initial disparity grid as input for Pandora2D, if the corresponding file contains a no data value in its metadata, pixels with this value in the initial disparity grid will not be processed in the Pandora2D pipeline (see Inputs).
To add a no data value to a tif file that does not contain one, you can use this command:
gdal_translate -a_nodata -9999 image.tif image_nodata.tif
Where -9999 is the no data value you want to add, image.tif is the path to your original tif file and image_nodata.tif is the path to the new tif file with no data added.