Opencv C++寻找阈值图像中的运动
我正在使用 openCv 和 C++,我试图在不同的光照条件下找到一个移动的球。到目前为止,我可以通过使用 HSV 颜色空间对图像进行阈值处理来过滤图像。这样做的问题是它会拾取具有相似颜色的其他物体。每次有不同颜色/背景的球时,计算出准确的 HSV 范围是非常乏味的。
有没有办法让我在阈值二值图像上应用任何过滤器来仅检测正在移动的对象?这样我只会找到球,而不会找到其他物体,因为它们通常是静止的。
谢谢你,
瓦伦
I am using openCv with C++ and I am trying to find a moving ball under different lighting conditions. So far I am able to filter an image by thresholding it using HSV color space. The problem with this is that it will pick up other object that have a similar color. It is very tedious to figure out the exact hsv range everytime there is a ball with different color/background.
Is there a way for me to apply any filter on the thresholded binary image to detect only the objects that are moving? This way I will only find the ball and not other objects since they are usually stationary.
Thank you,
Varun
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最简单的方法是图像序列中的帧差异/背景学习。
帧差分:连续两个帧相减,结果就是运动部分(你可能只会得到运动物体的边缘)
背景学习:例如建立50帧以上的平均值,这将是你学习的背景,然后减去当前帧,同样的区别是移动部分
Simplest approach would be frame differencing / background learning in an image sequence.
frame differencing: substract two successive frames, the result is the moving part (you will probably only get the edges of moving objects)
background learning: e.g. build an average over 50 frames, this would be your learned background, then substract the current frame, again the difference is the moving part