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

drawCircle

Draw a circle on an image.


Description

Draw a circle on an image.

Usage

drawCircle(img, x, y, radius, col, fill=FALSE, z=1)

Arguments

img

An Image object or an array.

x, y, radius

numerics indicating the center and the radius of the circle.

col

A numeric or a character string specifying the color of the circle.

fill

A logical indicating whether the circle should be filled. Default is FALSE.

z

A numeric indicating on which frame of the image the circle should be drawn. Default is 1.

Value

An Image object or an array, containing the transformed version of img.

Author(s)

Gregoire Pau, 2010

Examples

## Simple white circle
  x = matrix(0, nrow=300, ncol=300)
  y = drawCircle(x, 100, 200, 47, col=1)
  display(y)
  
  ## Simple filled yellow circle
  x = channel(y, 'rgb')
  y = drawCircle(x, 200, 140, 57, col='yellow', fill=TRUE)
  display(y)

EBImage

Image processing and analysis toolbox for R

v4.32.0
LGPL
Authors
Andrzej Oleś, Gregoire Pau, Mike Smith, Oleg Sklyar, Wolfgang Huber, with contributions from Joseph Barry and Philip A. Marais
Initial release

We don't support your browser anymore

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