responsivityMetrics: Compute Metrics for a Light Responder (e.g. a camera) or a...

View source: R/colorSpec.metrics.R

responsivityMetricsR Documentation

Compute Metrics for a Light Responder (e.g. a camera) or a Material Responder (e.g. a scanner)

Description

This function computes a few technical metrics regarding some geometric objects related to a responder: the spherical chromaticity polygon, cone, convex cone, and color-solid.

Currently the function only works if the number of spectra in x is 3 (e.g. RGB or XYZ). In this case the rows of as.matrix(x) (after weighting by step size) are called the generators; they are vectors in R^3 and we require that they are all in some open linear halfspace (unless a generator is 0). The 0-based rays through the generators intersect a plane inside the halfspace to form the vertices of the chromaticity polygon P. The 0-based rays through points of the interior of P form a cone, and the convex hull of this cone is a convex cone. The central projection of P onto the unit sphere is the spherical chromaticity polygon P_S. If type is 'responsivity.material', then x has an object-color solid or Rösch Farbkörper, which is a zonohedron Z. See Centore and vignette Convexity and Transitions for details.
Some simplification of the generators is performed during pre-processing. Generators that are 0 (in all channels) are removed, and a group of generators that are all positive multiples of each other is replaced by their sum. The 3-vectors are called the condensed generators. These simplifications do not change any of the geometric objects defined above.

Usage

## S3 method for class 'colorSpec'
responsivityMetrics( x )

Arguments

x

a colorSpec object with type equal to 'responsivity.light' or 'responsivity.material', and 3 spectra

Value

responsivityMetrics() returns a list with these items:

generators

a pair of integers, the 1st is the number of original generators, and the 2nd is the number of condensed generators

zeros

vector of wavelengths at which the responsivity is 0 (in all 3 channels)

multiples

a list of vectors of wavelengths; the responsivities in each vector (group) are positive multiples of each other

salient

a logical where TRUE means that there is some open linear halfspace that contains all the non-zero generators. If all the responsivities are non-negative, which is the usual case, then salient=TRUE.

normal

If salient=TRUE, then the inward pointing unit normal for the previous halfspace. Otherwise, normal=NA.

If salient=TRUE, then the list also contains:

concavities

a data.frame with 2 columns: wavelength and extangle, where extangle is the external angle at the wavelength (for the spherical chromaticity polygon P_S), and is negative. A negative angle means that P_S is concave at that vertex.

coneangle

the solid angle of the cone generated by the generators. This is identical to the area of the spherical chromaticity polygon, with concavities preserved.

cxconeangle

the solid angle of the convex cone generated by the generators, with no concavities. This is identical to the area of the convex hull of the spherical chromaticity polygon. If all responsivities are non-negative, which is the usual case, then this solid angle is less than the solid angle of an octant, which is \pi/2.

If the type of x is 'responsivity.material' then the list also contains:

area

the surface area of the object-color solid of x

volume

the volume of the object-color solid of x

In case of global error, the function returns NULL.

Note

To determine the value of salient, the package quadprog might be required.

References

Centore, Paul. A zonohedral approach to optimal colours. Color Research & Application. Vol. 38. No. 2. pp. 110-119. April 2013.

See Also

type, vignette Convexity and Transitions


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