2017-09-29 41 views
2

我使用python 3.6和scipy。替代方法scipy.ndimage的旋转

scipy.ndimage和 是否有替代功能旋转?它们将如何被调用?

我需要一个比scipy.ndimage.rotate更高级的函数,它们也使用插值。

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

这只是一个例子。

预先感谢您!

回答

1

对于旋转图像,有很多选项。以下是几个:

  • 随着OpenCV:Here is a tutorial。功能是cv2.rotate
  • 带枕头(PIL):Here is a tutorial

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

  • 随着SciPy的,还有另外一个功能:scipy.ndimage.interpolation.rotate

  • 此外Scikit图像(skimage)有其自身的旋转功能:skimage.transform.rotate