Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

draw_circle

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

imager

Image Processing Library Based on 'CImg'

v0.42.10
LGPL-3
Authors
Simon Barthelme [aut], David Tschumperle [ctb], Jan Wijffels [ctb], Haz Edine Assemlal [ctb], Shota Ochi [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.