cars.applications.holes_detection.holes_detection_tools

This module contains function for holes detection.

Module Contents

Functions

get_roi_coverage_as_poly_with_margins(...)

Finds all roi existing in binary msk and stores their coverage as

localize_masked_areas(→ numpy.ndarray)

Calculates bbox of masked region(s) if mask exists for

classif_to_stacked_array(disp_map, class_index)

Convert disparity dataset to mask correspoding to all classes

cars.applications.holes_detection.holes_detection_tools.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

Parameters
  • msk_values (np.ndarray) – msk layer of left/right epipolar image dataset

  • row_offset (int) – offset on row to apply

  • col_offset (int) – offset on col to apply

  • margin (int) – margin added to bbox in case masked region is localized at tile border (to ensure later disparity values at mask border extraction)

Returns

list of polygon

cars.applications.holes_detection.holes_detection_tools.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)

Parameters
  • dataset (CarsDataset) – epipolar image dataset

  • classification (List of str) – label of masked region to use

  • row_offset (int) – offset on row to apply

  • col_offset (int) – offset on col to apply

  • margin (int) – margin added to bbox in case masked region is localized at tile border (to ensure later disparity values at mask border extraction)

Returns

bounding box of masked area(s)

cars.applications.holes_detection.holes_detection_tools.classif_to_stacked_array(disp_map, class_index)

Convert disparity dataset to mask correspoding to all classes

Parameters
  • disp_map (xarray Dataset) – disparity dataset

  • class_index (list of str) – classification tags