ovl.target_filters.sorters module¶
-
ovl.target_filters.sorters.
area_sort
(contour_list, descending_sort=True)[source]¶ Sorts the list of contours by contour sort, default is from large to small
Parameters: - contour_list – the list of contours to be sorted, list of ndarrays
- descending_sort – a flag that reverses the sort order set to
Returns: the sorted contour list
-
ovl.target_filters.sorters.
circle_sort
(contour_list, area_limit=0.9, radius_limit=0.8)[source]¶ Sorts the list of contours according to how much they are circle from most similar to least using the circle rating function.
Parameters: - contour_list (list or one contour(numpy array)) – list of Contours to filter
- area_limit – The area limit for the circle rating, look at Geometry.circle_rating
- radius_limit – the radius limit for the circle rating, look at Geometry.circle_rating
Returns: the list sorted by circle rating
-
ovl.target_filters.sorters.
dec_area_sort
(contour_list)[source]¶ Sorts the list of contours from the largest to the smallest based on area of the contour
Parameters: contour_list – List of Contours to be sorted Returns: the contour list sorted.
-
ovl.target_filters.sorters.
dec_length_sort
(contour_list)[source]¶ Sorts the list of contours from the largest to the smallest based on area of the contour
Parameters: contour_list – List of Contours to filter Returns: the contour list sorted.
-
ovl.target_filters.sorters.
distance_sort
(contour_list, point)[source]¶ Sorts the contours according to their distance from the NOTE: it is important to area filter before image_center_sort
Parameters: - contour_list (List or one contour (numpy array)) – The list of contours to be sorted
- point – the point from which the distance of all contours are sorted by
Returns: the sorted contour list
-
ovl.target_filters.sorters.
image_center_sort
(contour_list, image_dimensions=(320, 240))[source]¶ Sorts the contours from the closest to the center to the farthest. NOTE: it is important to area filter before image_center_sort
Parameters: - contour_list – list of contours to be sorted
- image_dimensions – the dimensions of the image
Returns: