recolorize_adjacency {recolorize}R Documentation

Run pavo's adjacency and boundary strength analysis on a recolorize object

Description

Run adjacency (Endler 2012) and boundary strength (Endler et al. 2018) analysis directly on a recolorize object, assuming a human viewer (i.e. using CIE Lab and HSL color distances that correspond to perceptual distances of human vision). This is achieved by converting the recolorize object to a pavo::classify object, converting the colors to HSL space, and calculating a pavo::coldist object for CIE Lab color space before running pavo::adjacent.

Usage

recolorize_adjacency(
  recolorize_obj,
  xscale = 1,
  coldist = "default",
  hsl = "default",
  ...
)

Arguments

recolorize_obj

A recolorize object.

xscale

The length of the x-axis, in preferred units. Passed to pavo::adjacent.

coldist

A pavo::coldist object; otherwise, this argument is ignored and a coldist object for human vision is calculated from RGB colors converted to CIE Lab using cielab_coldist.

hsl

A dataframe with patch, hue, sat and lum columns specifying the HSL values for each color patch, to be passed to pavo::adjacent. Otherwise, this argument is ignored and HSL values are calculated for human vision from the RGB colors in the recolorize object.

...

Further arguments passed to pavo::adjacent.

Details

Eventually, the plan is to incorporate more sophisticated color models than using human perceptual color distances, i.e. by allowing users to match color patches to spectra. However, this does return reasonable and informative results so long as human vision is an appropriate assumption for the image data.

Value

The results of pavo::adjacent; see that documentation for the meaning of each specific value.

See Also

pavo::adjacent, classify_recolorize

Examples

img <- system.file("extdata/chongi.png", package = "recolorize")
recolorize_obj <- recolorize(img, method = "k", n = 2)
recolorize_adjacency(recolorize_obj)


[Package recolorize version 0.1.0 Index]