colour_checker_detection.detection.approximate_contour#
- colour_checker_detection.detection.approximate_contour(contour: ArrayLike, points: int = 4, iterations: int = 100) NDArrayInt [source]#
Approximate given contour to have given number of points.
The process uses binary search to find the best epsilon value producing a contour approximation with exactly
points
.- Parameters:
- Returns:
Approximated contour.
- Return type:
References
[Olf19]
Examples
>>> contour = np.array([[0, 0], [1, 0], [1, 1], [1, 2], [0, 1]]) >>> approximate_contour(contour, 4) array([[0, 0], [1, 0], [1, 2], [0, 1]]...)