colour_checker_detection.detection.quadrilateralise_contours#

colour_checker_detection.detection.quadrilateralise_contours(contours: ArrayLike) Tuple[NDArrayInt, ...][source]#

Convert given to quadrilaterals.

Parameters:

contours (ArrayLike) – Contours to convert to quadrilaterals

Returns:

Quadrilateralised contours.

Return type:

tuple

Examples

>>> contours = np.array(
...     [
...         [[0, 0], [1, 0], [1, 1], [1, 2], [0, 1]],
...         [[0, 0], [1, 2], [1, 0], [1, 1], [0, 1]],
...     ]
... )
>>> quadrilateralise_contours(contours)  
(array([[0, 0],
       [1, 0],
       [1, 2],
       [0, 1]]...), array([[0, 0],
       [1, 2],
       [1, 0],
       [1, 1]]...))