0 Posted 2020-01-22Updated 2024-01-11Python / Scripting / Practicea few seconds read (About 52 words)PIL image to np.arrayPIL, np.array PIL.Image转换成OpenCV格式 ##reference https://blog.csdn.net/dcrmg/java/article/details/78147219import cv2from PIL import Imageimport numpyimage = Image.open("plane.jpg")image.show()img = cv2.cvtColor(numpy.asarray(image),cv2.COLOR_RGB2BGR)cv2.imshow("OpenCV",img)cv2.waitKey() PIL image to np.arrayhttps://karobben.github.io/2020/01/22/Python/PIL_np.array/AuthorKarobbenPosted on2020-01-22Updated on2024-01-11Licensed under#PythonImage