ovl.target_filters.shape_filters.constraining_circle_filter module

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

Filters out contour which are not approximately circle, also limits by radius ratio (unlike circle_filter).

Parameters:
  • contour_list – list of contours (numpy arrays) to be filtered
  • min_area_ratio – minimum ratio between the area of the enclosing

circle and the contour (contour /enclosing circle) :param min_len_ratio: minimum ratio between the radius of the enclosing circle and the enclosing rectangle. :return: the list of contours that fit the criteria