Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem in loading the image..

import numpy as np import cv2

img = cv2.imread("mud.jpeg",cv2.IMREAD_COLOR)

cv2.imshow("bhatnagar",img) cv2.waitKey(5)

This is the error I am getting: I have even tried by giving the path of the image which could also be done if in case the file is not in the working directory.

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp, line 325

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

click to hide/show revision 2
retagged

updated 2017-12-16 07:25:18 -0600

berak gravatar image

Problem in loading the image..

import numpy as np import cv2

img = cv2.imread("mud.jpeg",cv2.IMREAD_COLOR)

cv2.imshow("bhatnagar",img) cv2.waitKey(5)

This is the error I am getting: I have even tried by giving the path of the image which could also be done if in case the file is not in the working directory.

OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp, line 325

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