块状图片-将矩阵旋转270度 [英] Numpy image - rotate matrix 270 degrees

查看:103
本文介绍了块状图片-将矩阵旋转270度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个代表灰度图像的Numpy 2d数组,我需要将其旋转270度.在这里可能会有点厚,但是我可以找到的两种方法似乎很……循环:

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)))

我认为一次操作必须有更好的方法来做到这一点.基本上是rot270()函数?有任何想法吗?

I'm thinking there must be a better way to do this in one operation. Basically a rot270() function? Any ideas?

推荐答案

您可以告诉rot90

You can tell rot90 to rotate several times, this should work:

rotated = numpy.rot90(orignumpyarray,3)

这篇关于块状图片-将矩阵旋转270度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆