# 代码如下,实现了,但结果可能是错误的,不是我想要的灰度,有人帮我看看,看起来很简单,但我不知道哪里错了
导入 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