colour.characterisation.colour_correction_matrix_Finlayson2015

colour.characterisation.colour_correction_matrix_Finlayson2015(M_T, M_R, degree=1, root_polynomial_expansion=True)[source]

Computes a colour correction matrix from given \(M_T\) colour array to \(M_R\) colour array using Finlayson et al. (2015) method.

Parameters
  • M_T (array_like, (n, 3)) – Test array \(M_T\) to fit onto array \(M_R\).

  • M_R (array_like, (n, 3)) – Reference array the array \(M_T\) will be colour fitted against.

  • degree (int, optional) – Expanded polynomial degree.

  • root_polynomial_expansion (bool) – Whether to use the root-polynomials set for the expansion.

Returns

Colour correction matrix.

Return type

ndarray, (n, 3)

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
>>> colour_correction_matrix(M_T, M_R)  
array([[ 1.0526376...,  0.1378078..., -0.2276339...],
       [ 0.0739584...,  1.0293994..., -0.1060115...],
       [ 0.0572550..., -0.2052633...,  1.1015194...]])