pandora.marge ============= .. py:module:: pandora.marge .. autoapi-nested-parse:: This module contains the function which defines the images margins. Functions --------- .. autoapisummary:: pandora.marge.get_margins Module Contents --------------- .. py:function:: get_margins(disp_min: int, disp_max: int, cfg: Dict[str, dict]) -> xarray.Dataset 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. :param disp_min: minimal disparity :type disp_min: int :param disp_max: maximal disparity :type disp_max: int :param cfg: user configuration :type cfg: dict of dict :return: margin for the images, 2D (image, corner) DataArray, with the dimensions image = ['left_margin', 'right_margin'], corner = ['left', 'up', 'right', 'down'] :rtype: xr.dataset