ex01.py 269 B

123456789101112
  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_RGB2GRAY)
  7. img_out = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
  8. plt.imshow(img_out)
  9. # plt.imshow(img_out, cmap="gray")
  10. plt.show()