image_draw_polygons: Draw polygons on an image

View source: R/img.R

image_draw_polygonsR Documentation

Draw polygons on an image

Description

Draw polygons on an image

Usage

image_draw_polygons(image, x, ...)

Arguments

image

image either an object of class magick-image or a path to an image file on disk

x

a list vector where each list element contains columns x and y indicating the positions of the polygon

...

further arguments passed on to polygon

Value

a magick-image

Examples

library(magick)
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      <- image_read(img)
plt      <- image_draw_polygons(img, x$coords, col = "#FF000080", border = "blue", lwd = 2)
plt

DIGI-VUB/madoc.utils documentation built on Sept. 14, 2022, 3:03 p.m.