Skip to contents

drawEllipse draws ellipses (or part of) over an Image object. This operation is destructive: it changes irreversibly the Image object and cannot be undone.

Usage

drawEllipse(
  image,
  x,
  y,
  axis1,
  axis2,
  angle,
  start_angle = 0,
  end_angle = 360,
  color = "red",
  thickness = 1
)

Arguments

image

An Image object.

x

A numeric value or vector representing the x coordinates of the centers of each ellipse

y

A numeric value or vector representing the y coordinates of the centers of each ellipse

axis1

A numeric value or vector representing the half-length of the first axis of each ellipse.

axis2

A numeric value or vector representing the half-length of the second axis of each ellipse.

angle

A numeric value or vector representing the angle in degrees between axis1 and the horizontal.

start_angle

A numeric value or vector representing the start angle in degrees of each elliptic arc (default: 0).

end_angle

A numeric value or vector representing the end angle in degrees of each elliptic arc (default: 360).

color

A value or vector of any kind of R color specification compatible with col2bgr representing the color of each ellipse's outline (default: "red").

thickness

A numeric value or vector representing the thickness in pixels of each ellipse's outline (default: 1). If negative, then a filled ellipse is drawn.

Value

This function does not return anything. It modifies image in place.

Author

Simon Garnier, garnier@njit.edu

Examples

balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
drawEllipse(balloon, 365, 245, 120, 90, angle = 45, thickness = 3)
#> NULL