rotate rotates an image in multiples of 90 degrees.
Arguments
- image
An
Imageobject.- rotation
A character string indicating the desired rotation:
- "CLOCKWISE" (default):
rotate by 90 degrees clockwise.
- "COUNTER":
rotate by 90 degrees counterclockwise.
- "180":
rotate by 180 degrees.
- target
The location where the results should be stored. It can take 3 values:
- "new":
a new
Imageobject is created and the results are stored inside (the default).- An
Imageobject: the results are stored in another existing
Imageobject. This is fast and will not replace the content ofimagebut will replace that oftarget. Note thattargetmust have the same bit depth and number of channels asimage. The dimensions must be the same ifrotation="CLOCKWISE", or inverted ifrotation="CLOCKWISE"orrotation="COUNTER".
Value
If target="new", the function returns an Image
object. If target is an Image object, the function
returns nothing and modifies that Image object in place.
Author
Simon Garnier, garnier@njit.edu
Examples
img <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
img_rotated <- rotate(img)