image_crop_area | R Documentation |
Extract a polygonal region, optionally limiting the extracting to the bounding box
image_crop_area(image, x, bbox = FALSE, ...)
image |
|
x |
a list vector where each list element contains columns x and y indicating the positions of the points of the polygon
or a single data.frame with columns |
bbox |
logical indicating to limit the result to the bounding box of the polygon |
... |
further arguments currently not used |
a magick-image
or a list of magick-image
objects
library(opencv) path <- system.file(package = "madoc.utils", "extdata", "pagexml-example.xml") x <- read_pagexml(path) x img <- system.file(package = "madoc.utils", "extdata", "pagexml-example.jpg") img <- ocv_read(img) pts <- x$points[[1]] area <- image_crop_area(img, pts, bbox = FALSE) area area <- image_crop_area(img, pts, bbox = TRUE) area areas <- image_crop_area(img, x$points, bbox = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.