【发布时间】:2019-02-03 05:58:44
【问题描述】:
#代码如下,实现了,但结果可能是错误的,不是我想要的灰度,有人帮帮我,看起来很简单,但我不知道哪里错了
p>导入 cv2 将 matplotlib.pyplot 导入为 plt 将 numpy 导入为 np 将 matplotlib.image 导入为 mpimg img = cv2.imread('calibration_test.png')
# i want simply convert the rgb image to grayscale and then print it out
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.imshow(gray)
print(gray.shape)
# but the outcome is a colorful image
【问题讨论】: