powered by
Extract crops from a single image represented by a processed dataframe
extractBoxesFromFlat( image, min_conf = 0, buffer = 0, save = TRUE, resize = NA, outdir = "", quality = 0.8 )
A dataframe containing image and crop paths
dataframe containing MD output (assumes single row)
Confidence threshold (defaults to 0, not in use)
Adds a buffer to the MD bounding box, defaults to 2px
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) { crops <- extractBoxesFromFlat(mdresflat[1, ], save = TRUE, out) }
Run the code above in your browser using DataLab