get_bounds: Get Face Bounds

View source: R/view_bounds.R

get_boundsR Documentation

Get Face Bounds

Description

Get the bounds detected by tem_to_xml() (uses dlib.get_frontal_face_detector()).

Usage

get_bounds(xml, crop = FALSE, subset = NULL)

Arguments

xml

The file path for the XML file created by tem_to_xml()

crop

Whether to crop the image to the bounds

subset

indices of images to subset

Value

A stimlist with a 4-point template of the top-left, top-right, bottom-right, and bottom-left corners of the bounding box, optionally cropped to this box

Examples

xml <- system.file("demo/_images.xml", package = "webmorphR.dlib")
bounds <- get_bounds(xml)
cropped <- get_bounds(xml, crop = TRUE)

## Not run: 
  # plot images
  bounds |>
    draw_tem(line.alpha = 1, line.color = "green") |>
    c(cropped) |>
    plot(nrow = 1)

## End(Not run)

debruine/webmorphR.dlib documentation built on Sept. 26, 2022, 10:08 a.m.