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 (>=2). For instance, dichromatic: photo=2; trichromatic: photo=3; tetrachromatic: photo=4, etc. Default gets number of photoreceptor types from C argument.

type

Whether the colour space should be built with a fixed vector length (type="length"), or a fixed distance between vertices (type="edge"; e.g. Pike 2012 and Renoult et al. 2015).

length

Vector length used to construct the colour space. Used when type="length". Typically length=1.

edge

Edge length used to construct the colour space. Used when type="edge".

R

Reflectance of observed objects. A data frame with first column corresponding to wavelength values and following columns with reflectance values. R must be in the same scale as Rb.

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. Rb must be in the same scale as in R.

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 photor).

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, func=log for a ln-transformation.

unity

Whether sum of photoreceptor output should be normalized to 1, as in EMmodel

recep.noise

Logical. Whether chromaticity distances should be calculated based on receptor noises.

noise.given

Logical. Whether receptor noise is provided (noise.given = TRUE) or calculated from photoreceptor relative abundances (noise.given = FALSE). Used when recep.noise=TRUE.

e

Receptor noise of each photoreceptor type. Used when recep.noise = TRUE and noise.given = TRUE

n

Relative number of each photoreceptor type in the retina. Used to calculate e when recep.noise = TRUE and noise.given = TRUE.

v

Noise-to-signal ratio of a single photoreceptor. Used to calculate e when recep.noise = TRUE and noise.given = TRUE.

interpolate

Whether data files should be interpolated before further calculations. See approx.

nm

A sequence of numeric values specifying where interpolation is to take place. See approx.

Value

ei

Noise of photoreceptor channels. Calculated only when recep.noise=TRUE

Qri

Photoreceptor photon catch values from R. Relative Photoreceptor photon catches when vonKries=TRUE. See functions Q and Qr.

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 (R) in relation to the background (Rb)

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)

[Package colourvision version 2.0.3 Index]