Ask Your Question

Revision history [back]

imshow misunderstanding ?

"2.bmp" is a valid bitmap file located in the correct folder. So what's wrong with the following code to make it produce the error ...

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


import cv2

ifile = cv2.imread("C:\Users\ericnei\My Work\2.bmp")

cv2.imshow("Demo",ifile)

cv2.waitKey(0)

cv2.destroyAllWindows()

click to hide/show revision 2
No.2 Revision

imshow misunderstanding ?

"2.bmp" is a valid bitmap file located in the correct folder. So what's wrong with the following code to make it produce the error ...

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


import cv2

cv2

ifile = cv2.imread("C:\Users\ericnei\My Work\2.bmp")

Work\2.bmp")

cv2.imshow("Demo",ifile)

cv2.waitKey(0)

cv2.destroyAllWindows()

cv2.imshow("Demo",ifile) cv2.waitKey(0) cv2.destroyAllWindows()