图片保存,读取

使用OpenCV

  • 读取
cv2.imread(image_path)
  • 保存
cv2.imwrite("path", image_name)

使用PIL

  • 读取
Image.open('images/city_128.png').convert('RGB')
  • 保存
img = Image.fromarray(img_norm, "RGB")
img.save(name, format='PNG')

猜你喜欢

转载自blog.csdn.net/qq_39124762/article/details/82350231