import cv2
import numpy as np
import os
file=os.listdir()
pictures=[i for i in file if i[-4:]=='.jpg']
name=1
for per_img in pictures:
img = cv2.imread(per_img)
rows,cols,channel = img.shape
M = cv2.getRotationMatrix2D((cols/2,rows/2),270,1)
dst = cv2.warpAffine(img,M,(cols,rows))
cv2.imwrite('270/%05d.tif'%name,dst)
name+=1
旋转图片之opencv
最新推荐文章于 2023-06-28 16:12:48 发布