试验from matplotlib import pyplot as pltimport numpy as npimport cv2image=cv2.imread('image/000000.jpg') plt.imshow(image) plt.show()import cv2import numpy as np#读取image=cv2.imread('image/000000.jpg') height,width=image.shape[:2]center=(width//2, height//2)#设置角度jiaodu=cv2.getRotationMatrix2D(center,70,1) rotated=cv2.warpAffine(image,jiaodu,(width, height)) #裁定大小(放大三倍)zoomed=cv2.resize(rotated, None, fx=3, fy=3) #准备输出cv2.imshow('xingjiarui',zoomed) cv2.waitKey(0)cv2.destroyAllWindows()cv2.imwrite('xingjiarui.jpg',zoomed) import cv2import numpy as np#读取image=cv2.imread('image/000000.jpg') #定坐标画三角points=np.array([[300, 100],[300, 200],[100, 200]],np.int32)points=points.reshape((-1, 1, 2))cv2.polylines(image,[points],isClosed=True,color=(255, 0, 0),thickness=2) #写拼音cv2.putText(image,'xingjiarui',(50, 50),cv2.FONT_HERSHEY_SIMPLEX,1,(0, 255, 0),2)#准备输出cv2.imshow('xingjiarui',image) cv2.waitKey(0) cv2.destroyAllWindows()cv2.imwrite('xingjiarui_000000.jpg',image)