Reputation: 115
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
Reputation: 3645
For rotating images, there are many options. Hereafter are a few ones:
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
.
skimage
) has its own rotation function: skimage.transform.rotate
Upvotes: 2