metrics: Image shape metrics

View source: R/metrics.R

metricsR Documentation

Image shape metrics

Description

Get metrics defined by template points.

Usage

metrics(stimuli, formula = c(0, 1))

Arguments

stimuli

list of stimuli with tems

formula

a vector of two points to measure the distance apart, or a string of the formula for the metric

Details

Reference x and y coordinates by point number like x[0] or y[188]. Use any R functions to process the numbers, as well as pow() (same as ^(), for consistency with webmorph.org). Remember that 0,0 is the top left for images; e.g., min(y[0], y[1]) gives your the higher of the two pupil y-coordinates.

Value

named vector of the metric

See Also

Other info: add_info(), compare(), get_info(), get_point(), height(), rename_stim(), width()

Examples

stimuli <- demo_stim()

metrics(stimuli, c(0, 1)) # eye-spacing

# face width-to-height ratio
fwh <- "abs(max(x[113],x[112],x[114])-min(x[110],x[111],x[109]))/abs(y[90]-min(y[20],y[25]))"
metrics(stimuli, fwh)


webmorphR documentation built on June 2, 2022, 5:07 p.m.