crop_tem: Crop to template boundaries and pad

View source: R/crop.R

crop_temR Documentation

Crop to template boundaries and pad

Description

Calculate the maximum and minimum x and y coordinates across the stimuli (or for each stimulus) and crop all image to this plus padding.

Usage

crop_tem(
  stimuli,
  top = 10,
  right = top,
  bottom = top,
  left = right,
  each = FALSE,
  ...
)

Arguments

stimuli

list of stimuli

top, right, bottom, left

numeric; number of pixels or proportion (<1) to pad each side

each

logical; Whether to calculate bounds for the full set (default) or each image separately

...

additional arguments to pass to crop()

Value

list of stimuli

See Also

Stimulus manipulation functions align(), crop(), greyscale(), horiz_eyes(), image_func(), mask_oval(), mask(), mirror(), pad(), resize(), rotate(), to_size()

Examples

stimuli <- demo_stim()
ctem <- crop_tem(stimuli, each = TRUE)
draw_tem(ctem)


# demo with different templates
stimuli <- demo_tems()

# default 10 pixels around maximum template
crop_tem(stimuli) 

# crop specific to each image
crop_tem(stimuli, each = TRUE)



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