import cv2 import numpy as np import matplotlib.pyplot as plt img = cv2.imread("gpu.bmp") # 转换格式 img_out = cv2.cvtColor(img,cv2.COLOR_RGB2BGR) # img_out = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY) plt.imshow(img_out) # plt.imshow(img_out,cmap="gray") plt.show()