cv2.error: C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:331: error: (-215) size.w

img = cv2.imread('F:/Pycharm_Projection/Test/图片/0.bmp')
cv2.imshow("Image", img)
cv2.waitKey(0)

使用python读取图片时出现以下错误:

cv2.error: C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:331: error: (-215) size.width>0 && size.height>0 in function cv::imshow

经网上查资料说是中文路径问题

修改后一切正常

    img = cv2.imread('F:/Pycharm_Projection/Test/img/0.bmp')
    cv2.imshow("Image", img)
    cv2.waitKey(0)

 

你可能感兴趣的:(python+opencv)