opencv 安装
pip install opencv-python
opencv:opencv_python 4.5.5.64
方法:
cv2.imwrite
def imwrite(filename, img, params=None):
输入:
输出:
示例:
import cv2
image_full_path="D:\\tt\\\airplane\\1.png"
image_save_full_path = "D:\\tt\\\airplane\\1_save.png"
# 以图片原有的格式加载
pri_image = cv2.imread(image_full_path, -1)
# 保存
cv2.imwrite(image_save_full_path, pri_image)