利用cvtColor 进行灰度转换时

import cv2
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt


image = Image.open('2.jpg')
plt.imshow(image)
plt.show()
image = np.asarray(image)
print(image)
image = cv2.cvtColor(image,cv2.COLOR_RGB2BGR)
plt.imshow(image)
plt.show()
print(image)

原图

 openvc之cvtColor的用法

结果图

 openvc之cvtColor的用法

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
相关资源
相似解决方案