colour.matrix_idt

colour.matrix_idt(sensitivities, illuminant, training_data=None, cmfs=XYZ_ColourMatchingFunctions(name='CIE 1931 2 Degree Standard Observer', ...), optimisation_factory=<function optimisation_factory_rawtoaces_v1>, optimisation_kwargs=None)[source]

Computes an Input Device Transform (IDT) matrix for given camera RGB spectral sensitivities, illuminant, training data, standard observer colour matching functions and optimization settings according to RAW to ACES v1 and P-2013-001 procedures.

Parameters
  • sensitivities (RGB_CameraSensitivities) – Camera RGB spectral sensitivities.

  • illuminant (SpectralDistribution) – Illuminant spectral distribution.

  • training_data (MultiSpectralDistributions, optional) – Training data multi-spectral distributions, defaults to using the RAW to ACES v1 190 patches.

  • cmfs (XYZ_ColourMatchingFunctions) – Standard observer colour matching functions.

  • optimisation_factory (callable, optional) – Callable producing the objective function and the CIE XYZ to optimisation colour model function.

  • optimisation_kwargs (dict_like, optional) – Parameters for scipy.optimize.minimize() definition.

Returns

Input Device Transform (IDT) matrix.

Return type

ndarray

References

[], []

Examples

Computing the Input Device Transform (IDT) matrix for a CANON EOS 5DMark II and CIE Illuminant D Series D55 using the method given in RAW to ACES v1:

>>> 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 = SDS_ILLUMINANTS['D55']
>>> np.around(
...     matrix_idt(sensitivities, illuminant), 3)
array([[ 0.85 , -0.016,  0.151],
       [ 0.051,  1.126, -0.185],
       [ 0.02 , -0.194,  1.162]])

The RAW to ACES v1 matrix for the same camera and optimized by Ceres Solver is as follows:

0.864994 -0.026302 0.161308 0.056527 1.122997 -0.179524 0.023683 -0.202547 1.178864

>>> np.around(matrix_idt(
...     sensitivities, illuminant,
...     optimisation_factory=optimisation_factory_JzAzBz), 3)
array([[ 0.848, -0.016,  0.158],
       [ 0.053,  1.114, -0.175],
       [ 0.023, -0.225,  1.196]])