opencv运行中遇到问题

opencv运行中遇到问题

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:967: error: (-215:Assertion failed) size.width>0 && size.height>0 in
function ‘cv::imshow’

cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:967: error: (-215:Assertion failed) size.width>0 && size.height>0 in 
function 'cv::imshow'

它可能意思是:图片路径中有中文

解决办法:
查看一下你这个路径中是不是’D:\text\picture.jpg’
把“\”改为"/"就好
如cv2.imread(‘D:/text/picture.jpg’)

你可能感兴趣的:(opencv运行中遇到的问题,opencv,计算机视觉,python)