Error (-215) size.width>0 && size.height>0 occurred when attempting to display an image using OpenCV

后端 未结 11 2595
渐次进展
渐次进展 2020-11-28 15:37

I am trying to run a simple program that reads an image from OpenCV. However, I am getting this error:

error: ......\\modules\\highgui\\src\\window.cpp:281:          


        
11条回答
  •  忘掉有多难
    2020-11-28 16:14

        img=cv2.imread('testpaper01-01.png')
        cv2.imshow('image',img)
        cv2.waitKey(0)
        cv2.destroyAllWindows()
    

    You have to mention the same format of your image file in the code(eg:-.jpg/.png/.jpeg/.tif etc.) and the directory of the image file must be same as the source code, I also got the same error but I rectified this way

提交回复
热议问题