machinevisiontoolbox.Image.rotate

Image.rotate(angle, centre=None)

Rotate an image

Parameters:
  • angle (scalar) – rotatation angle [radians]

  • centre (array_like(2)) – centre of rotation, defaults to centre of image

Returns:

rotated image

Return type:

Image

Rotate the image counter-clockwise by angle angle in radians.

Example:

>>> from machinevisiontoolbox import Image
>>> img = Image.Read('monalisa.png')
>>> out = img.rotate(0.5)
>>> out.disp()
<matplotlib.image.AxesImage object at 0x7f9627bf1310>
Note:
  • Rotation is defined with respect to a z-axis which is into the image, therefore counter-clockwise is a positive angle.

  • The pixels in the corners of the resulting image will be undefined.