computeADL: compute ADL coordinates by ray tracing

View source: R/colorSpec.optimal.R

computeADLR Documentation

compute ADL coordinates by ray tracing

Description

Consider a colorSpec object x with type equal to responsivity.material. The set of all possible material reflectance functions (or transmittance functions) is convex, closed, and bounded (in any reasonable function space), and this implies that the set of all possible output responses from x is also convex, closed, and bounded. The latter set is called the object-color solid or Rösch Farbkörper for x. A color on the boundary of the object-color solid is called an optimal color. The special points W (the response to the perfect reflecting diffuser) and 0 are on the boundary of this set. The interior of the line segment of neutrals joining 0 to W is in the interior of the object-color solid. It is natural to parameterize this segment from 0 to 1 (from 0 to W). The solid is symmetrical about the neutral gray midpoint G=W/2.

Now suppose that x has 3 spectra (3 responses) and consider a color response R not equal to G. There is a ray based at G and passing through R that intersects the boundary of the object-color solid at an optimal color B on the boundary with Logvinenko coordinates (\delta,\omega). If these 2 coordinates are combined with \alpha, where R = (1-\alpha)G + \alphaB, it yields the Logvinenko coordinates (\alpha,\delta,\omega) of R. These coordinates are also denoted by ADL; see References. A response is in the object-color solid iff \alpha \le 1. A response is optimal iff \alpha=1.

The coordinates of 0 are (\alpha,\delta,\omega)=(1,0,0). The coordinates of W are (\alpha,\delta,\omega)=(1,1,0). The coordinates of G are undefined.

Usage

## S3 method for class 'colorSpec'
computeADL( x, response )

Arguments

x

a colorSpec object with type equal to responsivity.material and 3 spectra

response

a numeric Nx3 matrix with responses in the rows, or a numeric vector that can be converted to such a matrix, by row.

Details

For each response, a ray is computed and the ray tracing is done by probeOptimalColors().

Value

computeADL() returns a data.frame with a row for each response. The columns in the data frame are:

response

the input response vector

ADL

the computed ADL coordinates of the response vector

omega

the reparameterized \lambda in the interval [0,1]; see References

lambda

lambda.1 and lambda.2 at the 2 transitions, in nm. lambda.1 < lambda.2 => bandpass, and lambda.1 > lambda.2 => bandstop.

If an individual ray could not be traced, or if the optimal spectrum has more than 2 transitions, the row contains NA in appropriate columns.
In case of global error, the function returns NULL.

WARNING

Since this function is really a simple wrapper around probeOptimalColors(), please see the performance warnings there.

References

Logvinenko, A. D. An object-color space. Journal of Vision. 9(11):5, 1-23, (2009).
https://jov.arvojournals.org/article.aspx?articleid=2203976. doi:10.1167/9.11.5.

Godau, Christoph and Brian Funt. XYZ to ADL: Calculating Logvinenko's Object Color Coordinates. Proceedings Eighteenth IS&T Color Imaging Conference. San Antonio. Nov 2009.

See Also

type(), probeOptimalColors(), vignette Plotting Chromaticity Loci of Optimal Colors

Examples

D50.eye = product( D50.5nm, 'varmat', xyz1931.1nm, wave=seq(360,830,by=5) )
computeADL( D50.eye, c(30,50,70) )
##    response.X response.Y response.Z   ADL.alpha   ADL.delta  ADL.lambda     omega 
##  1         30         50         70   0.7371475   0.5384104 473.3594572 0.3008817

##  lambda.1 lambda.2
##  427.2011 555.5261

## since alpha < 1, XYZ=c(30,50,70) is *inside* the object-color solid of D50.eye

colorSpec documentation built on May 29, 2024, 6 a.m.