import cv2 as cv
img = cv.imread("E:\PythonP\webTornado\aaa.jpg")
cv.namedWindow("Image")
cv.imshow("Image",img)
cv.waitKey(0)
cv.destroyAllWindows()
C:\Python27\python.exe E:/PythonP/webTornado/opencv.py
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 331
Traceback (most recent call last):
File "E:/PythonP/webTornado/opencv.py", line 6, in <module>
cv.imshow("Image",img)
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 = cv.imread("E://PythonP//webTornado//aaa.jpg")