imghelp.imgrotate

Module Contents

Functions

ImgRotate(img, degree)

Rotate an image either 90, 180, 270, 360 degrees counterclockwise.

imghelp.imgrotate.ImgRotate(img, degree)[source]

Rotate an image either 90, 180, 270, 360 degrees counterclockwise.

Function takes an image and rotates it the user-defined amount.

Parameters
  • img (numpy.array) – Input image.

  • degree (int) – Desired degree to rotate img: 90, 180, 270, 360.

  • Output

  • ------

    numpy.array

    Returns rotated image.

Examples

>>> import matplotlib.pyplot as plt
>>> from imghelp.ImgRotate import ImgRotate
>>> image = plt.imread('../test_img/ubc.jpeg')
>>> plt.imshow(image) # show the image
>>> ImgRotate(image, 270) # rotate image 270 degrees