face_detector
face_detector
sort_counterclockwise(points, centre=None)
This function is used to sort the points in a counterclockwise manner.
Parameters
points: the list of points to be sorted in the form of [(x,y), (x,y), ..., (x,y)] centre (optional): the center point of the list of points. If not provided, the function calculates the center of the points using the average of the x and y coordinates.
Returns
counterclockwise_points: the sorted points in counterclockwise order as a list of tuples
Source code in redesign_pipeline/face_detectors/face_detector.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | |