colour_checker_detection.detection.scale_contour#

colour_checker_detection.detection.scale_contour(contour: ArrayLike, factor: ArrayLike) NDArrayFloat[source]#

Scale given contour by given scale factor.

Parameters:
  • contour (ArrayLike) – Contour to scale.

  • factor (ArrayLike) – Scale factor.

Returns:

Scaled contour.

Return type:

numpy.ndarray

Warning

This definition returns floating point contours!

Examples

>>> contour = np.array([[0, 0], [1, 0], [1, 1], [0, 1]])
>>> scale_contour(contour, 2)  
array([[...-0.5, ...-0.5],
       [... 1.5, ...-0.5],
       [... 1.5, ... 1.5],
       [...-0.5, ... 1.5]]...)