GENmodel {colourvision} | R Documentation |
N-dimensional generic colour vision model
Description
A flexible function to build colour vision models based on any number of photoreceptor types (Gawryszewski 2018).
Usage
GENmodel(photo=ncol(C)-1, type="length", length=NA, edge=NA,
R, I, Rb=NA, C, vonKries = TRUE, func, unity=FALSE,
recep.noise=FALSE, noise.given=TRUE, e=NA, v=NA, n=NA,
interpolate=TRUE, nm=seq(300,700,1))
Arguments
photo |
Number of photoreceptor types. Model accepts any number of photoreceptor types ( |
type |
Whether the colour space should be built with a fixed vector length ( |
length |
Vector length used to construct the colour space. Used when |
edge |
Edge length used to construct the colour space. Used when |
R |
Reflectance of observed objects. A data frame with first column corresponding to wavelength values and following columns with reflectance values. |
I |
Irradiance spectrum. A data frame with two columns only: first column corresponding to wavelength values and second column with irradiance values. Irradiance values must be in quantum flux units. |
Rb |
Background reflectance. A data frame with two columns only: first column corresponding to wavelength values and second column with reflectance values. |
C |
Photoreceptor sensitivity curves, from lowest to longest lambda-max. A data frame: first column corresponding to wavelength values and following columns with photoreceptor sensitivity values (see function |
vonKries |
Whether the von Kries transformation should be applied to photoreceptor photon catches. Calculates the ratio between stimulus and background photoreceptor photon catches |
func |
Transformation of photoreceptors inputs. For instance, |
unity |
Whether sum of photoreceptor output should be normalized to 1, as in |
recep.noise |
Logical. Whether chromaticity distances should be calculated based on receptor noises. |
noise.given |
Logical. Whether receptor noise is provided ( |
e |
Receptor noise of each photoreceptor type. Used when |
n |
Relative number of each photoreceptor type in the retina. Used to calculate |
v |
Noise-to-signal ratio of a single photoreceptor. Used to calculate |
interpolate |
Whether data files should be interpolated before further calculations. See |
nm |
A sequence of numeric values specifying where interpolation is to take place. See |
Value
ei |
Noise of photoreceptor channels. Calculated only when |
Qri |
Photoreceptor photon catch values from |
Ei |
Photoreceptor outputs. |
Xi |
Stimulus colour locus coordinates in the colour space |
deltaS |
Euclidean distance to the origin of the colour space. It represents the conspicuousness of the stimulus ( |
Author(s)
Felipe M. Gawryszewski f.gawry@gmail.com
References
Gawryszewski, F.M. 2018. Colour vision models: Some simulations, a general n-dimensional model, and the colourvision R package. Ecology and Evolution, 10.1002/ece3.4288.
Pike, T.W. 2012. Generalised chromaticity diagrams for animals with n-chromatic colour vision. Journal of Insect Behavior 255: 277-286.
Renoult, J. P., A. Kelber, and H. M. Schaefer. 2015. Colour spaces in ecology and evolutionary biology. Biol Rev Camb Philos Soc, doi: 10.1111/brv.12230.
See Also
Q
, Qr
, CTTKmodel
, EMmodel
, RNLmodel
, colour_space
Examples
#A trichromatic colour vision model based on Endler and Mielke (2005)
##Photoreceptor sensitivity curves
##with lambda max at 350nm, 450nm and 550nm:
C<-photor(lambda.max=c(350,450,550))
##Gray background
##with 7 percent reflectance from 300 to 700nm:
Rb <- data.frame(300:700, rep(7, length(300:700)))
## Read CIE D65 standard illuminant
data("D65")
##Reflectance data
## with a sigmoid spectrum and midpoint at 500nm and 550 nm
R1<-logistic(x=seq(300,700,1), x0=500, L=50, k=0.04)
R2<-logistic(x=seq(300,700,1), x0=550, L=50, k=0.04)
R<-cbind(R1, R2[,2])
R[,2]<-R[,2]+10
R[,3]<-R[,3]+10
## Run model
model<-GENmodel(length=0.75, R=R, I=D65, Rb=Rb, C=C,
func=log, unity=TRUE)
plot(model)