colour.characterisation.matrix_colour_correction_Finlayson2015#

colour.characterisation.matrix_colour_correction_Finlayson2015(M_T: ArrayLike, M_R: ArrayLike, degree: Literal[1, 2, 3, 4] | int = 1, root_polynomial_expansion: bool = True) NDArrayFloat[source]#

Compute a colour correction matrix from test colour array \(M_T\) to reference colour array \(M_R\) using Finlayson et al. (2015) root-polynomial colour correction method.

Parameters:
  • M_T (ArrayLike) – Test array \(M_T\) to fit onto reference array \(M_R\).

  • M_R (ArrayLike) – Reference array the test array \(M_T\) will be colour fitted against.

  • degree (Literal[1, 2, 3, 4] | int) – Polynomial expansion degree for the root-polynomial basis. The value must be one of the degrees: 1, 2, 3, 4.

  • root_polynomial_expansion (bool) – Whether to use the root-polynomial basis set for the expansion. If False, uses standard polynomial expansion.

Returns:

Colour correction matrix mapping expanded test colours to reference colours.

Return type:

numpy.ndarray

References

[FMH15]

Examples

>>> prng = np.random.RandomState(2)
>>> M_T = prng.random_sample((24, 3))
>>> M_R = M_T + (prng.random_sample((24, 3)) - 0.5) * 0.5
>>> matrix_colour_correction_Finlayson2015(M_T, M_R)
array([[ 1.0526376...,  0.1378078..., -0.2276339...],
       [ 0.0739584...,  1.0293994..., -0.1060115...],
       [ 0.0572550..., -0.2052633...,  1.1015194...]])