Compute the CIE 1974 color rendering index (CRI) of a light spectrum,
called the the test illuminant.
From the given spectrum a reference illuminant is selected with the same CCT
(Correlated Color Temperature).
A selected set of 8 color samples is rendered in XYZ (1931) with both illuminants
and 8 color differences are computed in a special CIEUVW color space.
For each color difference a CRI is computed, where 100 is a perfect color match.
The final CRI is the average of these 8 CRI values.
# S3 method for colorSpec
computeCRI( x, adapt=TRUE, attach=FALSE, tol=5.4e-3 )
computeCRI()
returns a single number \(\le\) 100.
In case of ERROR it returns NA
.
If attach
is TRUE
a large list
of intermediate calculations is attached to the returned number.
an colorSpec R object with type
equal to 'light'
, and exactly 1 spectrum
if TRUE
, then a special chromatic adaption is performed, see Details
if TRUE
, then a large list of intermediate calculations
is attached to the returned number, as attribute data
.
This attached list includes data for all special 14 color samples, although
the last 6 do not affect the returned CRI.
for the CRI to be meaningful the chromaticities of the test and reference illuminants must be sufficiently close in the CIE
1960 uniform chromaticity space.
If the tolerance is exceeded, the function returns NA
.
The default tol=5.4e-3
is the one recommended by the CIE,
but the argument allows the user to override it.
The CCT of x
is computed by computeCCT()
with default options.
If adapt
is TRUE
the 8 test uv
points
are chromatically adapted from the test illuminant to the reference illuminant
using a special von Kries type transformation; see Oleari and
Wikipedia.
The test UVW values are computed relative to the reference illuminant.
If adapt
is FALSE
the 8 test uv
points
are not chromatically adapted,
and the test UVW values are computed relative to the test illuminant.
Oleari, Claudio, Gabriele Simone. Standard Colorimetry: Definitions, Algorithms and Software. John Wiley. 2016. pp. 465-470.
Günther Wyszecki and W. S. Stiles. Color Science: Concepts and Methods, Quantitative Data and Formulae, Second Edition. John Wiley & Sons, 1982. Table 1(3.11). p. 828.
Wikipedia. Color rendering index. https://en.wikipedia.org/wiki/Color_rendering_index
Hunt, R. W. G. and M. R. Pointer. Measuring Colour. 4th edition. John Wiley & Sons. 2011. Appendix 7.
type
,
xyz1931
,
computeCCT
computeCRI( subset(Fs.5nm,'F2') ) # returns 64.15195
computeCRI( subset(Fs.5nm,'F4') ) # returns 51.36348
Run the code above in your browser using DataLab