pandora2d.refinement.interpolation

This module contains functions associated to the interpolation method used in the refinement step.

Module Contents

Classes

Interpolation

Interpolation class allows to perform the subpixel cost refinement step

class pandora2d.refinement.interpolation.Interpolation(cfg: Dict)[source]

Bases: pandora2d.refinement.refinement.AbstractRefinement

Interpolation class allows to perform the subpixel cost refinement step

margins[source]
static check_conf(cfg: Dict) Dict[source]

Check the refinement configuration

Parameters:

cfg (dict) – user_config for refinement

Returns:

cfg: global configuration

Return type:

cfg: dict

static wrapper_interp2d(params: numpy.ndarray, func: scipy.interpolate.interp2d) numpy.ndarray[source]

Unpack tuple of arguments from minimize to fit in interp2d :param params: points coordinates :type params: np.array :param func: interp2d scipy function :type func: scipy.interpolate.interpolate.interp2d :return: minimum of interp2d functions at points :rtype: np.array

compute_cost_matrix(p_args) Tuple[float, float][source]

Process the interpolation and minimize of a cost_matrix :param cost_volumes: Dataset with 4D datas :type cost_volumes: xr.Dataset :param coords_pix_row: array from disp_min_row to disp_max_row :type coords_pix_row: np.array :param coords_pix_col: array from disp_min_col to disp_max_col :type coords_pix_col: np.array :param args_matrix_cost: 2D matrix with cost for one pixel (dim: dispy, dispx) :type args_matrix_cost: np.array :return: res: min of args_matrix_cost in 2D :rtype: Tuple(float, float)

refinement_method(cost_volumes: xarray.Dataset, pixel_maps: xarray.Dataset) Tuple[numpy.ndarray, numpy.ndarray][source]

Compute refine disparity maps :param cost_volumes: Cost_volumes has (row, col, disp_col, disp_row) dimensions :type cost_volumes: xr.Dataset :param pixel_maps: dataset of pixel disparity maps :type pixel_maps: xr.Dataset :return: delta_col, delta_row: subpixel disparity maps :rtype: Tuple[np.array, np.array]