Ask Your Question

error: OpenCV(3.4.1) C:\Miniconda3\conda-bld\opencv-suite_1533128839831\work\modules\highgui\src\window.cpp:356: error: (-215) size.width>0 && size.height>0 in function cv::imshow

asked 2019-04-12 21:15:25 -0500

updated 2019-04-13 09:25:30 -0500

supra56 gravatar image

i got the above error for this code so please help me to find out the reason.

 import cv2
#import numpy as np
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2019-04-13 09:29:15 -0500

supra56 gravatar image

updated 2019-04-13 10:05:16 -0500

You need to add filename.

edit flag offensive delete link more

answered 2019-04-13 01:37:58 -0500

berak gravatar image

updated 2019-04-13 09:32:07 -0500

your image was never read (imread() returns None silently on failure, and you will get errors in the next lines, trying to process an invalid image).

please make it a habit to check EVERY imread() call like:

im = cv2.imread(somepath)
if not im:
       # fail, you can't go on ! check the path, and try again
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-04-12 21:15:25 -0500

Seen: 66 times

Last updated: Apr 13