Код: Выделить всё
import cv2
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.image as 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


Подробнее здесь: https://stackoverflow.com/questions/520 ... matplotlib
Мобильная версия