powered by
Requires the unflattened raw MD output
extractBoxesFromMD( image, min_conf = 0, buffer = 0, return.crops = FALSE, save = FALSE, resize = NA, outdir = "", quality = 0.8 )
a flattened data.frame containing crop information
single image, raw MD output format (list)
Confidence threshold (defaults to 0, not in use)
Adds a buffer to the MD bounding box, defaults to 2px
Toggle to return list of cropped images, defaults to FALSE
Toggle to save output cropped, defaults to FALSE
Size in pixels to resize cropped images, NA if images are not resized, defaults to NA
Directory in which output cropped images will be saved
Compression level of output cropped image, defaults to 0.8
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.
if (FALSE) { images <- read_exif(imagedir, tags = c("filename","directory"), recursive = TRUE) crops <- extractBoxesFromMD(images[1, ], return.crops = TRUE, save = TRUE) }
Run the code above in your browser using DataLab