ex01.py 265 B

1234567891011
  1. import cv2
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. img = cv2.imread("gpu.bmp")
  5. # 转换格式
  6. img_out = cv2.cvtColor(img,cv2.COLOR_RGB2BGR)
  7. # img_out = cv2.cvtColor(img,cv2.COLOR_RGB2GRAY)
  8. plt.imshow(img_out)
  9. # plt.imshow(img_out,cmap="gray")
  10. plt.show()