
Image
drawRotatedRectangle
draws rotated rectangles over an
Image
object. This operation is destructive: it changes
irreversibly the Image
object and cannot be undone.
drawRotatedRectangle(
image,
x,
y,
axis1,
axis2,
angle,
color = "red",
thickness = 1
)
An Image
object.
A numeric value or vector representing the x coordinates of the center of each rectangle.
A numeric value or vector representing the y coordinates of the center of each rectangle.
A numeric value or vector representing the length of the first axis of each rectangle.
A numeric value or vector representing the length of the second axis of each rectangle.
A numeric value or vector representing the angle in degrees
between axis1
and the horizontal.
A value or vector of any kind of R color specification compatible
with col2bgr
representing the color of each rectangle's outline
(default: "red").
A numeric value or vector representing the thickness in pixels of each rectangle's outline (default: 1). If negative, then a filled rectangle is drawn.
This function does not return anything. It modifies image
in
place.
# NOT RUN {
balloon <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
drawRotatedRectangle(balloon, 290, 170, 440, 325, 60, thickness = 3)
# }
Run the code above in your browser using DataLab