pandora.marge

This module contains the function which defines the images margins.

Module Contents

Functions

get_margins(→ xarray.Dataset)

Calculates the margins for the left and right images according to the

pandora.marge.get_margins(disp_min: int, disp_max: int, cfg: Dict[str, dict]) xarray.Dataset[source]

Calculates the margins for the left and right images according to the steps present on the pipeline.

  • The margins are initialized at [+-disp_max, 0, -+disp_min, 0] for right and left images.

  • For matching_cost computation, a margin of half the window size is considered.

  • For vfit refinement, a margin of 1 pixel size is considered at positions 0 and 2.

  • For median filter, a margin of half the filter size is considered.

  • For SGM or 3SGM optimization, since infinite margins are theoretically required, a relatively high value (40 pixels) is considered.

  • The maximum margin obtained between (matching_cost + vfit refinement + median filter) and SGM/3SGM will be considered.

Parameters:
  • disp_min (int) – minimal disparity

  • disp_max (int) – maximal disparity

  • cfg (dict of dict) – user configuration

Returns:

margin for the images, 2D (image, corner) DataArray, with the dimensions image = [‘left_margin’, ‘right_margin’], corner = [‘left’, ‘up’, ‘right’, ‘down’]

Return type:

xr.dataset