我使用 python 3.6 和 scipy。
是否有 scipy.ndimage 的替代函数旋转和 他们怎么称呼?
我需要一个函数,它比 scipy.ndimage.rotate 的性能更好,并且它们还使用插值。
import scipy.ndimage as sn
sn.rotate(array, theta, reshape=False, order=3)
这只是一个示例。
提前谢谢您!
最佳答案
对于旋转图像,有很多选项。以下是一些:
- 使用 OpenCV:Here is a tutorial 。函数为
cv2.rotate
带枕头 (PIL):Here is a tutorial .
从 PIL 导入图像 img = Image.open("图片.png") rotated_img2 = img.rotate(10) # 角度 = 10
使用 Scipy,还有另一个函数:
scipy.ndimage.interpolation.rotate
。- Scikit-image (
skimage
) 也有自己的旋转函数:skimage.transform.rotate
关于python-3.x - scipy.ndimage 的替代方法旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46490594/