Image 在Python中旋转图像

Image 在Python中旋转图像,image,python-2.7,numpy,image-processing,scikit-image,Image,Python 2.7,Numpy,Image Processing,Scikit Image,` 上述代码给出的输出大小为(10,4,10)。但是图像应该是旋转的,它的大小应该是(3,10,10) 有什么建议以及如何继续执行代码 skimage.rotate无法旋转3个波段的图像。你必须一次旋转一个带子 import numpy import skimage.io from skimage.transform import rotate tr_1 = numpy.random.rand(5,300) training_inputs = [numpy.reshape(tr_1[x,:],

`

上述代码给出的输出大小为(10,4,10)。但是图像应该是旋转的,它的大小应该是(3,10,10)


有什么建议以及如何继续执行代码

skimage.rotate
无法旋转3个波段的图像。你必须一次旋转一个带子

import numpy 
import skimage.io
from skimage.transform import rotate
tr_1 = numpy.random.rand(5,300)
training_inputs = [numpy.reshape(tr_1[x,:], (3,10,10)) for x in range(len(tr_1))]
f = rotate(training_inputs[1], 90, resize=True)
f
形状将是
(3,10,10)

import numpy as np
import skimage.io
from skimage.transform import rotate
tr_1 = numpy.random.rand(5,300)
training_inputs = [np.reshape(tr_1[x,:], (3,10,10)) for x in range(len(tr_1))]
f0 = rotate(training_inputs[1][0], 90, resize=True)
f1 = rotate(training_inputs[1][1], 90, resize=True)
f2 = rotate(training_inputs[1][2], 90, resize=True)
f = np.rollaxis(np.dstack((f0, f1, f2)), 2, 0)