ovl.target_filters.shape_filters.straight_rectangle_filter module

ovl.target_filters.shape_filters.straight_rectangle_filter.straight_rectangle_filter(contour_list, min_area_ratio: Union[float, ovl.helpers.types.RangedNumber.<locals>.Hint] = 0.8)[source]

Receives a list of contours and returns only those that are approximately a rectangle that its sides are parallel to the frame of the image

Parameters:
  • contour_list (List) – List of Contours to filter
  • min_area_ratio (float) – The minimum ratio between the rectangle and the contour
Returns:

the contour list filtered.