请帮助我......我想知道如何编写背景扣除代码
我刚刚开始使用 OpenCV。我遇到了这个问题,我试图找到该代码的来源。有什么想法吗?
I'm just getting started with OpenCV. I came across this question, and I'm trying to find where that code came from. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您没有背景的参考图像,那么您可以尝试对前 n 帧进行平均,并使用此类结果图像作为参考。这个数字
n
可以是 20 或类似的值,如果场景不太复杂的话应该足够了。我建议您阅读 OpenCV 官方书籍中有关背景扣除的章节(http://www .amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134),因为还有一些其他类似的技术。If you don't have reference image of the background then you could try to make an average of first
n
frames and use such resultant image as a reference. This number,n
, could be 20 or similar and it should be enough if the scene isn't too complex. I recommend you to read a chapter about background subtraction in official OpenCV book (http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134) as there are some of other similar techniques presented.