Is OpenCV for Python or C++ a good library to use for detecting the blinking rate/frequency of an LED diode lights?

asked 2018-05-17 03:38:07 -0500

masterenol gravatar image

image description

In the picture, we can see a frame which tells us where the LEDs are located on an Oculus Rift headset and the blinking rate of the each LED.

I would like to build something like in the picture shown, but with a NOIR (no infrared) camera of 640x480 resolution and 15 to 30 frames per second (FPS). Can OpenCV be used to determine the LED blink frequency (Hertz Hz I believe) of a different number of LEDS and track their locations very similarly as shown in the picture above and the video below?:

If I need a camera with higher resolution and frame rate, would I be able to accomplish my goal with a video capture feed of 1080x1920 60 fps?

edit retag flag offensive close merge delete



forget youtube videos, but look at nyquist

(you'll need at least twice the sampling frequency of your blink rate)

berak gravatar imageberak ( 2018-05-17 03:41:32 -0500 )edit

This is an interesting response berak, thank you.

masterenol gravatar imagemasterenol ( 2018-05-17 04:02:35 -0500 )edit

@LBerger, thanks!

masterenol gravatar imagemasterenol ( 2018-05-17 20:11:05 -0500 )edit

@berak. If my understanding is correct, the numeric value of the frames per second of a webcam (30 for example) is equal to or approximately equal to the numeric value of the sampling frequency I can work with (30). So if I have a set LEDs with a blink rate under 15 blinks per second, I should be able to use OpenCV and a webcam to track the position of each unique LED by identifying each LED's unique blink rate. Is this correct? The concept of sampling is new to me, so I thank you for your help and patience.

masterenol gravatar imagemasterenol ( 2018-05-18 00:19:01 -0500 )edit

yes, that's correct. however, tracking the position is independant of that. (will work with a slower cam, too)

you may want to read a bit about (1d) signal processing, like filtering and fft, too.

berak gravatar imageberak ( 2018-05-18 00:58:26 -0500 )edit