pandora.cost_volume_confidence.interval_bounds ============================================== .. py:module:: pandora.cost_volume_confidence.interval_bounds .. autoapi-nested-parse:: This module contains functions for estimating interval bounds for the disparity Classes ------- .. autoapisummary:: pandora.cost_volume_confidence.interval_bounds.IntervalBounds Module Contents --------------- .. py:class:: IntervalBounds(**cfg: str) Bases: :py:obj:`pandora.cost_volume_confidence.cost_volume_confidence.AbstractCostVolumeConfidence` IntervalBounds class allows to estimate a confidence interval from the cost volume .. py:attribute:: _POSSIBILITY_THRESHOLD :value: 0.9 .. py:attribute:: _AMBIGUITY_THRESHOLD :value: 0.6 .. py:attribute:: _AMBIGUITY_KERNEL_SIZE :value: 5 .. py:attribute:: _VERTICAL_DEPTH :value: 0 .. py:attribute:: _QUANTILE_REGULARIZATION :value: 1.0 .. py:attribute:: _method :value: 'interval_bounds' .. py:attribute:: cfg .. py:attribute:: _possibility_threshold .. py:attribute:: _ambiguity_indicator :value: '' .. py:attribute:: _ambiguity_threshold .. py:attribute:: _ambiguity_kernel_size .. py:attribute:: _regularization .. py:attribute:: _vertical_depth .. py:attribute:: _quantile_regularization .. py:attribute:: _indicator :value: 'interval_bounds' .. py:attribute:: _indicator_inf :value: 'interval_bounds_inf' .. py:attribute:: _indicator_sup :value: 'interval_bounds_sup' .. py:method:: check_conf(**cfg: Union[str, float, int, bool]) -> Dict[str, Union[str, float, int, bool]] Add default values to the dictionary if there are missing elements and check if the dictionary is correct :param cfg: interval_bounds configuration :type cfg: dict :return cfg: interval_bounds configuration updated :rtype: dict .. py:method:: desc() -> None Describes the confidence method :return: None .. py:method:: confidence_prediction(disp: xarray.Dataset, img_left: xarray.Dataset = None, img_right: xarray.Dataset = None, cv: xarray.Dataset = None) -> Tuple[xarray.Dataset, xarray.Dataset] Computes a confidence measure that evaluates the minimum and maximum disparity at each point with a confidence of possibility_threshold % :param disp: the disparity map dataset :type disp: xarray.Dataset :param img_left: left Dataset image :tye img_left: xarray.Dataset :param img_right: right Dataset image :type img_right: xarray.Dataset :param cv: cost volume dataset :type cv: xarray.Dataset :return: the disparity map and the cost volume with new indicators 'interval_bounds.inf' and 'interval_bounds.sup' in the DataArray confidence_measure :rtype: Tuple(xarray.Dataset, xarray.Dataset) with the data variables: - confidence_measure 3D xarray.DataArray (row, col, indicator) .. py:method:: compute_interval_bounds(cv: numpy.ndarray, disp_interval: numpy.ndarray, possibility_threshold: float, type_factor: float, grids: numpy.ndarray, disparity_range: numpy.ndarray) -> Tuple[numpy.ndarray, numpy.ndarray] :staticmethod: Computes interval bounds on the disparity. :param cv: cost volume :type cv: 3D np.ndarray (row, col, disp) :param disp_interval: disparity data :type disp_interval: 1D np.ndarray (disp,) :param possibility_threshold: possibility threshold used for interval computation :type possibility_threshold: float :param type_factor: Either 1 or -1. Used to adapt the possibility computation to max or min measures :type type_factor: float :param grids: array containing min and max disparity grids :type grids: 2D np.ndarray (min, max) :param disparity_range: array containing disparity range :type disparity_range: np.ndarray :return: the infimum and supremum (not regularized) of the set containing the true disparity :rtype: Tuple(2D np.ndarray (row, col) dtype = float32, 2D np.ndarray (row, col) dtype = float32)