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

imrotate

Rotate an image along the XY plane.


Description

If cx and cy aren't given, the default is to centre the rotation in the middle of the image. When cx and cy are given, the algorithm used is different, and does not change the size of the image.

Usage

imrotate(im, angle, cx, cy, interpolation = 1L, boundary = 0L)

Arguments

im

an image

angle

Rotation angle, in degrees.

cx

Center of rotation along x (default, image centre)

cy

Center of rotation along y (default, image centre)

interpolation

Type of interpolation. One of 0=nearest,1=linear,2=cubic.

boundary

Boundary conditions. One of 0=dirichlet, 1=neumann, 2=periodic

See Also

imwarp, for flexible image warping, which includes rotations as a special case

Examples

imrotate(boats,30) %>% plot
#Shift centre to (20,20)
imrotate(boats,30,cx=20,cy=20) %>% 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.