解决python测试opencv时imread导致的错误问题
如下所示:
import cv2 import numpy as np img = cv2.imread("1.jpg")//图片和代码在同个目录,改为相对路径,解决由imread引起的打不开图片或找不到图片的路径问题 cv2.imshow("1",img) cv2.waitKey(10000)
D:\>my.py OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\highgui\src\window.cpp, line 325 Traceback (most recent call last): File "D:\my.py", line 5, in <module> cv2.imshow("1",img) cv2.error: C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\highgui\src\window.cpp:325: error: (-215) size.width>0 && size.height>0 in function cv::imshow D:\>
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16