Numpy image - rotate matrix 270 degrees

后端 未结 2 1960
青春惊慌失措
青春惊慌失措 2020-12-17 09:01

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 se

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 09:27

    rotated_array =numpy.rot90(orignumpyarray,3)
    

    Explanation of the function:

    numpy.rot90(a,b)
    a = Array which you want to rotate
    b = How many times you want to rotate it by 90 degrees. For here you want 270° so 90° * 3 = 270° that is why b = 3 here.

提交回复
热议问题