Python 3.6 + opencv 3.4 中imshow 函数报错 10
在Windows10环境下为python配置好opencv库后,运行测试代码:importcv2importnumpyasnpimg=cv2.imread("C:\\Us...
在Windows 10环境下为python配置好opencv库后,运行测试代码:
import cv2
import numpy as np
img = cv2.imread("C:\\Users\\可会至道\\Desktop\\xin.jpg")
cv2.namedWindow("image")
cv2.imshow("image",img)
cv2.waitKey(0)
但是在imshow处报错,错误如下:
raceback (most recent call last):
File "F:\Python 3.6\test.py", line 5, in <module>
cv2.imshow("image",img)
cv2.error: OpenCV(3.4.1) D:\Build\OpenCV\opencv-3.4.1\modules\highgui\src\window.cpp:364: error: (-215) size.width>0 && size.height>0 in function cv::imshow
请问错误原因是什么,如何解决? 展开
import cv2
import numpy as np
img = cv2.imread("C:\\Users\\可会至道\\Desktop\\xin.jpg")
cv2.namedWindow("image")
cv2.imshow("image",img)
cv2.waitKey(0)
但是在imshow处报错,错误如下:
raceback (most recent call last):
File "F:\Python 3.6\test.py", line 5, in <module>
cv2.imshow("image",img)
cv2.error: OpenCV(3.4.1) D:\Build\OpenCV\opencv-3.4.1\modules\highgui\src\window.cpp:364: error: (-215) size.width>0 && size.height>0 in function cv::imshow
请问错误原因是什么,如何解决? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询