mask_oval | R Documentation |
Superimpose an oval mask on a set of images.
mask_oval(stimuli, bounds = NULL, fill = wm_opts("fill"), each = TRUE)
stimuli |
list of stimuli |
bounds |
bounds (t, r, b, l) of oval, calculated from templates if NULL |
fill |
background color for mask, see |
each |
logical; whether to calculate a mask for each image (default) or just one |
If the images have templates and bounds = NULL
, the maxiumum and minimum x and y coordinates for each image will be calculated (or the overall max and min if each = FALSE
) and an oval with those dimensions and position will be placed over the face.
If bounds
are set to a list of top, right, bottom and left boundaries, these will be used instead of the boundaries derived from templates.
list of stimuli with cropped tems and/or images
Stimulus manipulation functions
align()
,
crop_tem()
,
crop()
,
greyscale()
,
horiz_eyes()
,
image_func()
,
mask()
,
mirror()
,
pad()
,
resize()
,
rotate()
,
to_size()
# remove external template points and crop stimuli <- demo_stim() |> subset_tem(features("face")) |> crop_tem(25) # three styles of mask omask1 <- mask_oval(stimuli) |> label("default") omask2 <- mask_oval(stimuli, each = FALSE) |> label("each = FALSE") omask3 <- mask_oval(stimuli, bounds = list(t= 50, r = 30, b = 40, l = 30)) |> label("manual bounds") # visualise masks c(omask1, omask2, omask3) |> plot(nrow = 2, byrow = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.