gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 17:50:26 27 4
gpt4 key购买 nike

当我运行从此链接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:

最佳答案


cv2.line(mask, (a,b),(c,d), color[i].tolist(), 2)
cv2.circle(frame,(a,b),5,color[i].tolist(),-1)

代替
mask = cv2.line(mask, (a,b),(c,d), color[i].tolist(), 2)
frame = cv2.circle(frame,(a,b),5,color[i].tolist(),-1)

关于python - 错误:..\..\..\opencv-2.4.8\modules\highgui\src\window.cpp:269:错误:(-215)size.width> 0 && size.height> 0在函数cv中: :imshow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22955634/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com