pandora.cost_volume_confidence.ambiguity
This module contains functions for estimating confidence from ambiguity.
Module Contents
Classes
Ambiguity class allows to estimate a confidence from the cost volume |
- class pandora.cost_volume_confidence.ambiguity.Ambiguity(**cfg: str)[source]
Bases:
pandora.cost_volume_confidence.cost_volume_confidence.AbstractCostVolumeConfidence
Ambiguity class allows to estimate a confidence from the cost volume
- check_conf(**cfg: str | float) Dict[str, str | float] [source]
Add default values to the dictionary if there are missing elements and check if the dictionary is correct
- Parameters:
cfg (dict) – ambiguity configuration
- Return cfg:
ambiguity configuration updated
- Return type:
dict
- confidence_prediction(disp: xarray.Dataset, img_left: xarray.Dataset = None, img_right: xarray.Dataset = None, cv: xarray.Dataset = None) Tuple[xarray.Dataset, xarray.Dataset] [source]
Computes a confidence measure that evaluates the matching cost function at each point
- Parameters:
disp (xarray.Dataset) – the disparity map dataset
img_left – left Dataset image
img_right (xarray.Dataset) – right Dataset image
cv (xarray.Dataset) – cost volume dataset
- Tye img_left:
xarray.Dataset
- Returns:
the disparity map and the cost volume with a new indicator ‘ambiguity_confidence’ in the DataArray confidence_measure
- Return type:
Tuple(xarray.Dataset, xarray.Dataset) with the data variables:
confidence_measure 3D xarray.DataArray (row, col, indicator)
- normalize_with_percentile(ambiguity)[source]
Normalize ambiguity with percentile
- Parameters:
ambiguity (2D np.array (row, col) dtype = float32) – ambiguity
- Returns:
the normalized ambiguity
- Return type:
2D np.array (row, col) dtype = float32
- static compute_ambiguity(cv: numpy.ndarray, _eta_min: float, _eta_max: float, _eta_step: float) numpy.ndarray [source]
Computes ambiguity.
- Parameters:
cv (3D np.array (row, col, disp)) – cost volume
_eta_min (float) – minimal eta
_eta_max (float) – maximal eta
_eta_step (float) – eta step
- Returns:
the normalized ambiguity
- Return type:
2D np.array (row, col) dtype = float32
- static compute_ambiguity_and_sampled_ambiguity(cv: numpy.ndarray, _eta_min: float, _eta_max: float, _eta_step: float)[source]
Return the ambiguity and sampled ambiguity, useful for evaluating ambiguity in notebooks
- Parameters:
cv (3D np.array (row, col, disp)) – cost volume
_eta_min (float) – minimal eta
_eta_max (float) – maximal eta
_eta_step (float) – eta step
- Returns:
the normalized ambiguity and sampled ambiguity
- Return type:
Tuple(2D np.array (row, col) dtype = float32, 3D np.array (row, col) dtype = float32)