pandora.cost_volume_confidence.risk
This module contains functions for estimating the risk.
Classes
Allows to estimate a risk confidence from the cost volume |
Module Contents
- class pandora.cost_volume_confidence.risk.Risk(**cfg: str)[source]
Bases:
pandora.cost_volume_confidence.cost_volume_confidence.AbstractCostVolumeConfidenceAllows to estimate a risk 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 risk 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 new indicators ‘risk_max_confidence’ and ‘risk_min_confidence’ in the
- Return type:
Tuple(xarray.Dataset, xarray.Dataset)
- static compute_risk(cv: numpy.ndarray, sampled_ambiguity: numpy.ndarray, etas: numpy.ndarray, nbr_etas: int, grids: numpy.ndarray, disparity_range: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray][source]
Computes minimum and maximum risk.
- Parameters:
cv (3D np.ndarray (row, col, disp)) – cost volume
sampled_ambiguity (3D np.ndarray (row, col, eta)) – sampled cost volume ambiguity
etas (np.ndarray) – range between eta_min and eta_max with step eta_step
nbr_etas (int) – number of etas
grids (2D np.ndarray (min, max)) – array containing min and max disparity grids
disparity_range (np.ndarray) – array containing disparity range
- Returns:
the minimum and maximum risk
- Return type:
Tuple(2D np.ndarray (row, col) dtype = float32, 2D np.ndarray (row, col) dtype = float32)
- static compute_risk_and_sampled_risk(cv: numpy.ndarray, sampled_ambiguity: numpy.ndarray, etas: numpy.ndarray, nbr_etas: int, grids: numpy.ndarray, disparity_range: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray][source]
Computes minimum and maximum risk and sampled_risk.
- Parameters:
cv (3D np.ndarray (row, col, disp)) – cost volume
sampled_ambiguity (3D np.ndarray (row, col, eta)) – sampled cost volume ambiguity
etas (np.ndarray) – range between eta_min and eta_max with step eta_step
nbr_etas (int) – nuber of etas
grids (2D np.ndarray (min, max)) – array containing min and max disparity grids
disparity_range (np.ndarray) – array containing disparity range
- Returns:
the risk
- Return type:
Tuple(2D np.ndarray (row, col) dtype = float32, 2D np.ndarray (row, col) dtype = float32, 3D np.ndarray (row, col) dtype = float32, 3D np.ndarray (row, col) dtype = float32)