import numpy as np import cv2 img=np.mat(np.zeros((300,300))) img=cv2.cvtColor(img,cv2.COLOR_GRAY2BGR) print(img.shape) cv2.imshow("test",img) cv2.waitKey(0)
pycharm下运行如上代码时,出现错误:OpenCV Error: Assertion failed (depth == 0 || depth == 2 || depth == 5) in cv::cvtColor, file D:\Build\OpenCV\opencv-3.4.0\modules\imgproc\src\color.cpp, line