使用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')
cv2.imread(image_path)
cv2.imwrite("path", image_name)
Image.open('images/city_128.png').convert('RGB')
img = Image.fromarray(img_norm, "RGB")
img.save(name, format='PNG')