报错:cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’
报错位置:下面代码第3行
img1_path = 'img1.jpg'
img11 = cv2.imread(img1_path)
img1_gray = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY) #颜色空间转换,转换为灰度图
报错原因:图片路径不能有中文!!!