A short implementation of the image rotation code, using the Skimage library, is said to be compared with PIL, skimage to numpy and other scientific computing library support better, here is to complete the brother to help him modify the program's task, If there is a need in the future, you may be able to comb the Python image processing library or make a filter based on your own needs to get a deeper look.
1 fromSkimageImportIo,transform2 ImportMatplotlib.pyplot as Plt3 4 5 " "Picture Rotation" "6 7Img2 = Io.imread ('./bg-body-3.jpg')8Img2 =transform.rotate (IMG2, 180)#rotates 90 degrees without changing the size9Plt.figure ('Skimage')Ten plt.imshow (IMG2) One plt.show () A Print(Img2.shape) - Print(Img2.dtype)
This library translates the read-in image data directly into Numpy.ndarray and converts the data type from uint8 to float64:
Output
(983, 1920x1080, 3) float64
"Python" skimage image processing _ Rotate Image