:py:mod:`cars.applications.hole_detection.hole_detection_tools` =============================================================== .. py:module:: cars.applications.hole_detection.hole_detection_tools .. autoapi-nested-parse:: This module contains function for holes detection. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: cars.applications.hole_detection.hole_detection_tools.get_roi_coverage_as_poly_with_margins cars.applications.hole_detection.hole_detection_tools.localize_masked_areas cars.applications.hole_detection.hole_detection_tools.classif_to_stacked_array .. py:function:: get_roi_coverage_as_poly_with_margins(msk_values: numpy.ndarray, row_offset=0, col_offset=0, margin=0) -> List[shapely.geometry.Polygon] Finds all roi existing in binary msk and stores their coverage as list of Polygon :param msk_values: msk layer of left/right epipolar image dataset :type msk_values: np.ndarray :param row_offset: offset on row to apply :type row_offset: int :param col_offset: offset on col to apply :type col_offset: int :param margin: margin added to bbox in case masked region is localized at tile border (to ensure later disparity values at mask border extraction) :type margin: int :return: list of polygon .. py:function:: localize_masked_areas(dataset: xarray.Dataset, classification: List[str], row_offset: int = 0, col_offset: int = 0, margin: int = 0) -> numpy.ndarray Calculates bbox of masked region(s) if mask exists for input image file (see configuration "mask" and "mask_classes" in input .json configuration file) :param dataset: epipolar image dataset :type dataset: CarsDataset :param classification: label of masked region to use :type classification: List of str :param row_offset: offset on row to apply :type row_offset: int :param col_offset: offset on col to apply :type col_offset: int :param margin: margin added to bbox in case masked region is localized at tile border (to ensure later disparity values at mask border extraction) :type margin: int :return: bounding box of masked area(s) .. py:function:: classif_to_stacked_array(disp_map, class_index) Convert disparity dataset to mask correspoding to all classes :param disp_map: disparity dataset :type disp_map: xarray Dataset :param class_index: classification tags :type class_index: list of str