colour.characterisation.training_data_sds_to_RGB

colour.characterisation.training_data_sds_to_RGB(training_data, sensitivities, illuminant)[source]

Converts given training data to RGB tristimulus values using given illuminant and given camera RGB spectral sensitivities.

Parameters
Returns

Tuple of training data RGB tristimulus values and white balance multipliers.

Return type

tuple

Examples

>>> path = os.path.join(
...     RESOURCES_DIRECTORY_RAWTOACES,
...     'CANON_EOS_5DMark_II_RGB_Sensitivities.csv')
>>> sensitivities = sds_and_msds_to_msds(
...     read_sds_from_csv_file(path).values())
>>> illuminant = normalise_illuminant(
...     SDS_ILLUMINANTS['D55'], sensitivities)
>>> training_data = read_training_data_rawtoaces_v1()
>>> RGB, RGB_w = training_data_sds_to_RGB(
...     training_data, sensitivities, illuminant)
>>> RGB[:5]  
array([[ 0.0207582...,  0.0196857...,  0.0213935...],
       [ 0.0895775...,  0.0891922...,  0.0891091...],
       [ 0.7810230...,  0.7801938...,  0.7764302...],
       [ 0.1995   ...,  0.1995   ...,  0.1995   ...],
       [ 0.5898478...,  0.5904015...,  0.5851076...]])
>>> RGB_w  
array([ 2.3414154...,  1.        ,  1.5163375...])