pandora.refinement.refinement
This module contains classes and functions associated to the subpixel refinement step.
Classes
Abstract Refinement class |
Module Contents
- class pandora.refinement.refinement.AbstractRefinement[source]
Abstract Refinement class
- subpixel_refinement(cv: xarray.Dataset, disp: xarray.Dataset) None[source]
Subpixel refinement of disparities and costs.
- Parameters:
cv (xarray.Dataset) –
the cost volume dataset with the data variables:
cost_volume 3D xarray.DataArray (row, col, disp)
confidence_measure 3D xarray.DataArray (row, col, indicator)
disp (xarray.Dataset) –
Dataset with the variables :
disparity_map 2D xarray.DataArray (row, col)
confidence_measure 3D xarray.DataArray (row, col, indicator)
validity_mask 2D xarray.DataArray (row, col)
- Returns:
None
- approximate_subpixel_refinement(cv_left: xarray.Dataset, disp_right: xarray.Dataset) xarray.Dataset[source]
Subpixel refinement of the right disparities map, which was created with the approximate method : a diagonal search for the minimum on the left cost volume
- Parameters:
cv_left (xarray.Dataset) –
the left cost volume dataset with the data variables:
cost_volume 3D xarray.DataArray (row, col, disp)
confidence_measure 3D xarray.DataArray (row, col, indicator)
disp_right (xarray.Dataset) –
right disparity map with the variables :
disparity_map 2D xarray.DataArray (row, col)
confidence_measure 3D xarray.DataArray (row, col, indicator)
validity_mask 2D xarray.DataArray (row, col)
- Returns:
disp_right Dataset with the variables :
disparity_map 2D xarray.DataArray (row, col) that contains the refined disparities
confidence_measure 3D xarray.DataArray (row, col, indicator) (unchanged)
validity_mask 2D xarray.DataArray (row, col) with the value of bit 3 ( Information: calculations stopped at the pixel step, sub-pixel interpolation did not succeed )
interpolated_coeff 2D xarray.DataArray (row, col) that contains the refined cost
- Return type:
xarray.Dataset
- classmethod register_subclass(short_name: str)[source]
Allows to register the subclass with its short name
- Parameters:
short_name (string) – the subclass to be registered
- static refinement_method(cost: numpy.ndarray, disp: float, measure: str) Tuple[float, float, int][source]
- Abstractmethod:
Return the subpixel disparity and cost
- Parameters:
cost (1D numpy array : [cost[disp -1], cost[disp], cost[disp + 1]]) – cost of the values disp - 1, disp, disp + 1
disp (float) – the disparity
measure (string = min | max) – the type of measure used to create the cost volume
- Returns:
the refined disparity (disp + (sub_disp/subpix)), the refined cost and the state of the pixel ( Information: calculations stopped at the pixel step, sub-pixel interpolation did not succeed )
- Return type:
float, float, int