标签:open read src less destory charm pen its ast
(1)错误代码import cv2 as cv
src = cv.imread("D:\images\我喜欢的发型\07.PNG")
cv.namedWindow("Hello", cv.WINDOW_AUTOSIZE)
cv.imshow("Hello", src)
cv.waitKey(0)
cv.destoryAllWindows()
D:\DevKits\Anaconda3\python.exe D:/workspace/pycharm/OpenCVNotes/Lesson1.py
Traceback (most recent call last):
File "D:/workspace/pycharm/OpenCVNotes/Lesson1.py", line 9, in <module>
cv.imshow("Hello", src)
cv2.error: OpenCV(4.0.0) d:\build\opencv\opencv-4.0.0\modules\highgui\src\window.cpp:358: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘cv::imshow‘
Process finished with exit code 1
cv2.imread()函数的filename参数不接受带有中文的路径.
import cv2 as cv
src = cv.imread("D:\images\me.png")
cv.namedWindow("Hello", cv.WINDOW_AUTOSIZE)
cv.imshow("Hello", src)
cv.waitKey(0)
cv.destoryAllWindows()
OpenCV报错size.width>0 && size.height>0 in function
标签:open read src less destory charm pen its ast
原文地址:http://blog.51cto.com/xvjunjie/2329649