import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
# 读取图像
img = cv.imread("bilibili.jpg",0)
# 显示图像
# 2.1 OPENCV
# cv.imshow("bilibili", img)
# cv.waitKey(0)
# cv.destroyAllWindows()
# 2.2 matplotlib
# plt.imshow(img[:,:,::-1])
# plt.show()
# # 3图像保存
cv.imwrite("bilibili2.png", img)
![图片[1]-python图像的io操作源代码-给我网盘资源](https://kngzs.cc/wp-content/uploads/2024/04/cover2-1024x711.jpg)
THE END