deltaS: Chromaticity distances

Description Usage Arguments Value Author(s) See Also Examples

View source: R/colourvision_package.R

Description

Calculates a matrix with all possible pairwise comparison between stimulus reflectance spectra based on a given colour vision model output.

Usage

1
deltaS(model)

Arguments

model

Output of a colour vision model

.

Value

A matrix with pairwise chromaticity distances.

Author(s)

Felipe M. Gawryszewski f.gawry@gmail.com

See Also

CTTKmodel, RNLmodel, EMmodel,GENmodel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
##Photoreceptor sensitivity curves
##with lambda max at 350nm, 450nm and 550nm:
C<-photor(lambda.max=c(350,450,550))

## Grey background
## with 10 percent reflectance from 300 to 700nm:
Rb <- data.frame(300:700, rep(10, length(300:700)))

## Read CIE D65 standard illuminant
data("D65")

## Reflectance data
## with a sigmoid spectrum and midpoint at 500nm
R1<-logistic(x=seq(300,700,1), x0=450, L=50, k=0.04)
R2<-logistic(x=seq(300,700,1), x0=500, L=50, k=0.04)
R3<-logistic(x=seq(300,700,1), x0=550, L=50, k=0.04)
R<-cbind(R1,R2[,2],R3[,2])

## Run model 
model<-CTTKmodel(photo=3, R=R, I=D65,
    Rb=Rb, C=C)

#Chromaticity distances between R1, R2 and R3
deltaS(model)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
                R   R2[, 2]   R3[, 2]
R       0.0000000 0.1800259 0.4325408
R2[, 2] 0.1800259 0.0000000 0.2727298
R3[, 2] 0.4325408 0.2727298 0.0000000

colourvision documentation built on Aug. 2, 2021, 1:06 a.m.