I've got a Numpy 2d array that represents a grey-scale image and I need to rotate it 270 degrees. Might be being a bit thick here but the two ways I can find to do this seem quite... circulous:
rotated = numpy.rot90(numpy.rot90(numpy.rot90(orignumpyarray)))
rotated = numpy.fliplr(numpy.flipud(numpy.rot90(orignumpyarray)))
I'm thinking there must be a better way to do this in one operation. Basically a rot270() function? Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…