python-3.x - scipy.ndimage 的替代方法旋转

标签 python-3.x scipy

我使用 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/

相关文章:

python - 如何在 Pandas 数据框中 self 引用列?

python - 在同一个图上一起绘制两个距离矩阵?

python - 如何从声音文件中获取振幅和频率?

python - numpy/核心/multiarray.so : undefined symbol: _Py_ZeroStruct

python - "import pkg.module"是否相当于 2.7 中 pkg/__init.py__ 中的 "import module"而不是 3.5 中的 0x104567910?

python - 如何创建一个带有参数的函数?

python - 提高 Numpy 性能

python-3.x - 无法在 opencv 3 中保存视频

python - ValueError : X. shape[1] = 2 should be equal to 13, 训练时的特征数

python - 将两个高斯组合成另一个高斯