ovl.target_filters.shape_filters.triangle_filter module¶
-
ovl.target_filters.shape_filters.triangle_filter.
triangle_filter
(contour_list, min_area_ratio: Union[float, ovl.helpers.types.RangedNumber.<locals>.Hint] = 0.8, approximation_coefficient: Union[float, ovl.helpers.types.RangedNumber.<locals>.Hint] = 0.02)[source]¶ Receives a list of contours and returns only those that are approximately triangle and have 3
Parameters: approximation_coefficient – the approximation coefficient affects how the contour’s perimeter is approximated, the larger the number is (out of 1) the more the approximation of the contour is a line :param contour_list: the list of contours to be filtered :param min_area_ratio: the minimum ratio between the area of the contour and the bounding triangle :return: the filtered list