Calculates color distances. When data are the result of
it applies the receptor-noise model of Vorobyev et al. (1998) to calculate color distances
with noise based on relative photoreceptor densities. It also accepts
from the hexagon, colour-opponent-coding, categorical, segment, and cielab models, in which case euclidean
distances (hexagon, cielab, categorical, segment) or manhattan distances (coc) are returned.
1 2 3
(required) quantum catch color data. Can be the result
how the noise will be calculated. (Ignored for
If only some of the comparisons should be returned, a character vector of length 1 or 2 can be provided, indicating which samples are desired. The subset vector must match the labels of the input samples, but partial matching (and regular expressions) are supported.
if the object is of class
photoreceptor densities for the cones used in visual modeling.
must have same length as number of columns (excluding achromatic receptor if used;
the Pekin robin Leiothrix lutea densities:
The Weber fraction to be used. The noise-to-signal ratio
the cone class used to obtain the empirical estimate of the
Weber fraction used for the
the Weber fraction to be used to calculate achromatic contrast, when
deprecated arguments. see below.
A data frame containing up to 4 columns.
The first two (
patch1, patch2) refer
to the two colors being contrasted;
dS is the chromatic contrast (delta S)
dL is the achromatic contrast (delta L). Units are JND's in the receptor-noise
model, euclidean distances in the categorical and segment space, manhattan distances in the
color-opponent-coding space, green-receptor contrast in the hexagon, and lightness (L)
contrast in the cielab model.
previous versions of
coldist calculated receptor noise using the arguments
v for the individual cone noise-to-signal ratio and
the relative cone densities. These arguments have been replaced by
n, which takes a vector of relative cone densities.
the user to specify which receptor to use as the reference to obtain the
desired Weber fraction, and
coldist calculates internally the value of
to be used when calculating the Weber fraction for the remaining cones.
This allows a more explicit choice of Weber fraction, without the need to find the
right value of
v to use in order to obtain the desired signal-to-noise ratio. Furthermore,
n to be entered as a vector,
coldist can now handle visual
systems with more than four photoreceptors.
In addition, the achromatic noise is calculated based on the
argument directly, and not based on
n4 as before.
Rafael Maia [email protected]
Vorobyev, M., Osorio, D., Bennett, A., Marshall, N., & Cuthill, I. (1998). Tetrachromacy, oil droplets and bird plumage colours. Journal Of Comparative Physiology A-Neuroethology Sensory Neural And Behavioral Physiology, 183(5), 621-633.
Hart, N. S. (2001). The visual ecology of avian photoreceptors. Progress In Retinal And Eye Research, 20(5), 675-703.
Endler, J. A., & Mielke, P. (2005). Comparing entire colour patterns as birds see them. Biological Journal Of The Linnean Society, 86(4), 405-431.
Olsson, P., Lind, O., & Kelber, A. (2015) Bird colour vision: behavioural thresholds reveal receptor noise. Journal of Experimental Biology, 218, 184-193.
Lind, O. (2016) Colour vision and background adaptation in a passerine bird, the zebra finch (Taeniopygia guttata). Royal Society Open Science, 3, 160383.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
## Not run: # Dichromat data(flowers) vis.flowers <- vismodel(flowers, visual = 'canis', relative = FALSE) didist.flowers <- coldist(vis.flowers) # Trichromat vis.flowers <- vismodel(flowers, visual = 'apis', relative = FALSE) tridist.flowers <- coldist(vis.flowers) # Trichromat, color-hexagon model (euclidean distances) vis.flowers <- vismodel(flowers, visual = 'apis', qcatch = 'Ei', relative = FALSE, vonkries = TRUE, achro = 'l', bkg = 'green') hex.flowers <- colspace(vis.flowers, space = 'hexagon') hexdist.flowers <- coldist(hex.flowers) # Trichromat, color-opponent-coding model (manhattan distances) vis.flowers <- vismodel(flowers, visual = 'apis', qcatch = 'Ei', relative = FALSE, vonkries = TRUE) coc.flowers <- colspace(vis.flowers, space = 'coc') hexdist.flowers <- coldist(coc.flowers) # Tetrachromat data(sicalis) vis.sicalis <- vismodel(sicalis, visual = 'avg.uv', relative = FALSE) tetradist.sicalis.n <- coldist(vis.sicalis) # This will also work, but give you several warnings you shouldn't ignore!! col.sicalis <- colspace(vis.sicalis) tetradist.sicalis.n <- coldist(col.sicalis) tetradist.sicalis.q <- coldist(vis.sicalis, noise = 'quantum') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.