colour_checker_detection.detection.swatch_masks#

colour_checker_detection.detection.swatch_masks(width: int, height: int, swatches_h: int, swatches_v: int, samples: int) NDArrayInt[source]#

Return swatch masks for given image width and height and swatches count.

Parameters:
  • width (int) – Image width.

  • height (int) – Image height.

  • swatches_h (int) – Horizontal swatches count.

  • swatches_v (int) – Vertical swatches count.

  • samples (int) – Sample count.

Returns:

Tuple of swatch masks.

Return type:

tuple

Examples

>>> from pprint import pprint
>>> pprint(swatch_masks(16, 8, 4, 2, 1))  
array([[ 1,  3,  1,  3],
       [ 1,  3,  5,  7],
       [ 1,  3,  9, 11],
       [ 1,  3, 13, 15],
       [ 5,  7,  1,  3],
       [ 5,  7,  5,  7],
       [ 5,  7,  9, 11],
       [ 5,  7, 13, 15]]...)