tumourkit.utils.preprocessing.format_contour
- tumourkit.utils.preprocessing.format_contour(contour: List[Tuple[float, float]]) List[Tuple[float, float]]
Formats a contour in cv2.findContours format to an array of shape (N,2). Additionally, the first point is added to the end to close the contour.
- Parameters:
contour (Contour) – The contour to be formatted.
- Returns:
The formatted contour.
- Return type:
Contour