Fedor v. R.
Fedor v. R.

Reputation: 115

alternative method rotate of scipy.ndimage

I use python 3.6 and scipy.

Is there an alternative function rotate of scipy.ndimage and how would they be called?

I need a function, which is performater than that of scipy.ndimage.rotate and they also uses a interpolation.

import scipy.ndimage as sn
sn.rotate(array, theta, reshape=False, order=3)

This is only a example.

Thank you in advance!

Upvotes: 2

Views: 807

Answers (1)

Eskapp
Eskapp

Reputation: 3645

For rotating images, there are many options. Hereafter are a few ones:

  • With OpenCV: Here is a tutorial. The function is cv2.rotate
  • With pillow (PIL): Here is a tutorial.

    from PIL import Image img = Image.open("image.png") rotated_img2 = img.rotate(10) # angle = 10

  • With Scipy, there is another function: scipy.ndimage.interpolation.rotate.

  • Also Scikit-image (skimage) has its own rotation function: skimage.transform.rotate

Upvotes: 2

Related Questions