draw_circle: Draw circle on image

View source: R/drawing.R View source: R/RcppExports.R

draw_circleR Documentation

Draw circle on image

Description

Add circle or circles to an image. Like other native CImg drawing functions, this is meant to be basic but fast. Use implot for flexible drawing.

Usage

draw_circle(im, x, y, radius, color = "white", opacity = 1, filled = TRUE)

Arguments

im

an image

x

x coordinates

y

y coordinates

radius

radius (either a single value or a vector of length equal to length(x))

color

either a string ("red"), a character vector of length equal to x, or a matrix of dimension length(x) times spectrum(im)

opacity

scalar or vector of length equal to length(x). 0: transparent 1: opaque.

filled

fill circle (default TRUE)

Value

an image

Author(s)

Simon Barthelme

See Also

implot

Examples

draw_circle(boats,c(50,100),c(150,200),30,"darkgreen") %>% plot
draw_circle(boats,125,60,radius=30,col=c(0,1,0),opacity=.2,filled=TRUE) %>% plot

dahtah/imager documentation built on Feb. 23, 2023, 10:16 p.m.