extractBoxesFromFlat {animl}R Documentation

Extract crops from a single image represented by a processed dataframe

Description

Extract crops from a single image represented by a processed dataframe

Usage

extractBoxesFromFlat(
  image,
  min_conf = 0,
  buffer = 0,
  save = TRUE,
  resize = NA,
  outdir = "",
  quality = 0.8
)

Arguments

image

dataframe containing MD output (assumes single row)

min_conf

Confidence threshold (defaults to 0, not in use)

buffer

Adds a buffer to the MD bounding box, defaults to 2px

save

Toggle to save output cropped, defaults to FALSE

resize

Size in pixels to resize cropped images, NA if images are not resized, defaults to NA

outdir

Directory in which output cropped images will be saved

quality

Compression level of output cropped image, defaults to 0.8

Details

A variable crop_rel_path in the image list can be used to change the path where the crops will be stored.

The final output path will be the outdir plus the crop_rel_path.

Value

A dataframe containing image and crop paths

Examples

## Not run: 
crops <- extractBoxesFromFlat(mdresflat[1, ], save = TRUE, out)

## End(Not run)

[Package animl version 1.1.0 Index]