简体   繁体   English

错误:.. \\ .. \\ .. \\ opencv-2.4.8 \\ modules \\ highgui \\ src \\ window.cpp:269:错误:(-215)size.width> 0 && size.height> 0在函数cv中: :imshow

[英]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尺寸不正确(根据错误widthheight为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.

相关问题 OpenCV(4.2.0) 错误: (-215:Assertion failed) size.width&gt;0 &amp;&amp; size.height&gt;0 in function 'cv::imshow' - OpenCV(4.2.0) error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' opencv 错误:(-215:断言失败)size.width&gt;0 &amp;&amp; size.height&gt;0 in function 'cv::imshow' - opencv error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' 相机流 - OpenCV 错误:(-215:断言失败)size.width>0 && size.height>0 in function 'cv::imshow' - Camera Streaming - OpenCV error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' 错误:函数imshow中的(-215)size.width&gt; 0 &amp;&amp; size.height&gt; 0 - error: (-215) size.width>0 && size.height>0 in function imshow 错误:(-215:断言失败)函数 cv::imshow 中的 size.width&gt;0 &amp;&amp; size.height&gt;0 - error: (-215:Assertion failed) size.width>0 && size.height>0 in function cv::imshow OpenCV 错误:(-215:断言失败)size.width>0 && size.height>0 in function 'imshow' - OpenCV error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow' OpenCV 错误:(-215)size.width&gt;0 &amp;&amp; size.height&gt;0 in function imshow - OpenCV Error: (-215)size.width>0 && size.height>0 in function imshow 相机校准opencv python imshow错误:(-215)size.width&gt; 0 &amp;&amp; size.height&gt; 0 - Camera Calibration opencv python imshow error: (-215) size.width>0 && size.height>0 错误:(-215:断言失败)函数“imshow”中的 size.width&gt;0 &amp;&amp; size.height&gt;0 - error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'imshow' OpenCV错误:在cv :: imshow(Python)中断言失败(size.width&gt; 0 &amp;&amp; size.height&gt; 0) - OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow (Python)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM