[英]error: ..\..\..\opencv-2.4.8\modules\highgui\src\window.cpp:269: error: (-215) size.width>0 && size.height>0 in function cv::imshow
when i run this code taken from this links http://docs.opencv.org/trunk/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.html they give the following code the give the following Error 当我运行从此链接http://docs.opencv.org/trunk/doc/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.html提取的代码时,它们会给出以下代码,并给出以下错误
Traceback (most recent call last):
File "C:\Python27\code\afan.py", line 48, in <module>
cv2.imshow('frame',img)
error: ..\..\..\opencv-2.4.8\modules\highgui\src\window.cpp:269: error: (-215) size.width>0 && size.height>0 in function cv::imshow:
Write 写
cv2.line(mask, (a,b),(c,d), color[i].tolist(), 2)
cv2.circle(frame,(a,b),5,color[i].tolist(),-1)
instead 代替
mask = cv2.line(mask, (a,b),(c,d), color[i].tolist(), 2)
frame = cv2.circle(frame,(a,b),5,color[i].tolist(),-1)
This error says that your img
doesn't have a correct size (in accordance to error width
or height
is 0). 此错误表示您的img
尺寸不正确(根据错误width
或height
为0)。
Check your image size. 检查图像尺寸。
Images has zero size just after creation. 刚创建后图像的大小为零。 Thus your img
is created, but is not initialized with any actual content. 因此,您的img
已创建,但未使用任何实际内容初始化。 Make sure that video files from tutorial are present and correctly loaded. 确保存在教程中的视频文件并正确加载。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.