背景扣除
我正在使用 opencv 进行背景减法。问题是前景物体并不总是被正确检测到。为了解决这个问题,我想使用四到五张图像,并将它们的平均值作为背景图像。我怎样才能做到这一点?
I'm doing background subtraction using opencv. The problem is the foreground object is not always detected correctly. To deal with this I would like to use four or five images, and take their average as the background image. How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许遍历所有图像,如果有问题的像素在所有图像的颜色变化范围内,是否将其视为背景?
然后我想范围的大小将决定你的挑剔程度以及你对相机的稳定性和一致性的信心。
Perhaps go through all the images, and if the pixel in question is within a certain range of colour variation for all the images, disregard it as background?
Then I suppose the size of the range would determine how picky you were and how confident you are in the stability and consistency of your camera.
您应该尝试使用 OpenCV 中包含的背景检测器(在 cvaux.h 下)。如果你想找到物体斑点,他们还有斑点探测器。
通过结合斑点信息和光流信息,通常可以找到前景物体。
You should try using the included background detector in OpenCV (under cvaux.h). They also have blob detector if you want to find object blob.
By combining blob information and optical flow information, you can usually find the foreground object.