colour.polynomial_expansion¶
-
colour.
polynomial_expansion
(a, method='Cheung 2004', **kwargs)[source]¶ Performs polynomial expansion of given \(a\) array.
- Parameters
a (array_like, (3, n)) – \(a\) array to expand.
method (unicode, optional) – {‘Cheung 2004’, ‘Finlayson 2015’, ‘Vandermonde’}, Computation method.
- Other Parameters
degree (int) – {
colour.characterisation.polynomial_expansion_Finlayson2015()
,colour.characterisation.polynomial_expansion_Vandermonde()
}, Expanded polynomial degree, must be one of [1, 2, 3, 4] forcolour.characterisation.polynomial_expansion_Finlayson2015()
definition.terms (int) – {
colour.characterisation.augmented_matrix_Cheung2004()
}, Number of terms of the expanded polynomial, must be one of [3, 5, 7, 8, 10, 11, 14, 16, 17, 19, 20, 22].root_polynomial_expansion (bool) – {
colour.characterisation.polynomial_expansion_Finlayson2015()
}, Whether to use the root-polynomials set for the expansion.
- Returns
Expanded \(a\) array.
- Return type
ndarray, (3, n)
References
[CWCR04], [FMH15], [WR04], [Wik03f]
Examples
>>> RGB = np.array([0.17224810, 0.09170660, 0.06416938]) >>> polynomial_expansion(RGB) array([ 0.1722481..., 0.0917066..., 0.0641693...]) >>> polynomial_expansion(RGB, 'Cheung 2004', terms=5) array([ 0.1722481..., 0.0917066..., 0.0641693..., 0.0010136..., 1...])