OpenCV:检测视频Feed中的闪烁灯 [英] OpenCV: Detect blinking lights in a video feed

查看:1222
本文介绍了OpenCV:检测视频Feed中的闪烁灯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个视频Feed。此视频Feed包含多个以不同速率闪烁的指示灯。所有的灯都是相同的颜色(他们都是红外LED)。如何检测这些闪烁灯的位置和频率?

I have a video feed. This video feed contains several lights blinking at different rates. All lights are the same color (they are all infrared LEDs). How can I detect the position and frequency of these blinking lights?

免责声明:我非常 。我有一个学习OpenCV的副本,但我发现它有点压倒性。如果任何人可以解释OpenCV术语中的解决方案,将非常感谢。

Disclaimer: I am extremely new to OpenCV. I do have a copy of Learning OpenCV, but I am finding it a bit overwhelming. If anyone could explain a solution in OpenCV terminology, it would be greatly appreciated. I am not expecting code to be written for me.

推荐答案

将序列中的每个图像的阈值设置为使LED:可见。如果您可以使用仅限保持LED并移除背景的阈值来设置阈值,那么您或多或少已完成,因为您现在需要做的是跟踪已经看到LED的每个位置,

Threshold each image in the sequence with a threshold that makes the LED:s visible. If you can threshold it with a threshold that only keeps the LED and removes background then you are more or less finished since all you need to do now is to keep track of each position that has seen a LED and count how often it occurs.

作为一个中间步骤,如果阈值化图像中存在背景噪声,则将使用侵蚀来消除小错误,然后可能在你实际感兴趣的blob中扩展到关闭洞。

As a middle step, if there is "background noise" in the thresholded image would be to use erosion to remove small mistakes, and then maybe dilate to "close holes" in the blobs you are actually interested in.

如果场景是静态的,你也可以通过取几个并从任何帧和阈值中去除所得到的中值图像。

If the scene is static you could also make a simple background model by taking the median of a few frames and removing the resulting median image from any frame and threshold that. Stuff that has changed (your LEDs) will appear stronger.

如果场景移动,我认为没有其他(简单)的解决方案比确保LED足够亮能够使用上面给出的阈值方法。

If the scene is moving I see no other (easy) solution than making sure the LED are bright enough to be able to use the threshold approach given above.

对于OpenCV:如果你知道你想做什么,找到一个函数不是很难。困难的部分是提出一种方法来解决问题,而不是实际的编码。

As for OpenCV: if you know what you want to do, it is not very hard to find a function that does it. The hard part is coming up with a method to solve the problem, not the actual coding.

这篇关于OpenCV:检测视频Feed中的闪烁灯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆