-
Hi, First time using this program and wanted to understand where I'm going wrong with this: The values for XYZ and LAB that the instrument provides are: 86.63, 91.80, 95.58, 96.74, -0.76 and 1.95 respectively Using the spectral data and the following code:
gives me the results:
which doesn't match with what the instrument give me (above) going the other way so taking the LAB the instrument gives and using LAB_to_XYZ gives me what I expect.
I initially thought it was the MSDS_CMFS choice but I tried all of them and the 1964 was the closest and the illuminant is correct. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, Without seeing how the instrument does the integration, it is hard to know where the difference is coming from. It seems like though that the spectral distribution is given without spectral bandpass correction, try this and it should get you closer: import colour
import numpy as np
cmfs = colour.MSDS_CMFS["CIE 1964 10 Degree Standard Observer"]
illuminant = colour.SDS_ILLUMINANTS["D65"]
shape = colour.SpectralShape(400, 700, 10)
obs = colour.CCS_ILLUMINANTS["CIE 1964 10 Degree Standard Observer"]["D65"]
data = np.array(
[
45.42,
73.35,
85.37,
88.85,
89.43,
89.86,
90.33,
90.61,
90.88,
91.15,
91.46,
91.55,
91.67,
91.93,
91.92,
92.12,
92.28,
92.23,
92.26,
92.10,
92.19,
92.08,
91.85,
91.76,
91.57,
91.33,
91.22,
90.81,
90.34,
89.79,
88.54,
]
)
sd = colour.bandpass_correction(colour.SpectralDistribution(data, shape)) / 100
XYZ = colour.sd_to_XYZ(sd, cmfs, illuminant)
LAB = colour.XYZ_to_Lab(XYZ / 100, obs)
# [ 86.62746005 91.80419271 95.56581136]
# [ 96.740207 -0.76756712 1.95650694]
# Reference
# 86.63, 91.80, 95.58
# 96.74, -0.76 1.95
print(XYZ)
print(LAB) |
Beta Was this translation helpful? Give feedback.
Hello,
Without seeing how the instrument does the integration, it is hard to know where the difference is coming from. It seems like though that the spectral distribution is given without spectral bandpass correction, try this and it should get you closer: