my question is similar to this one: OpenCV: Detect blinking lights in a video feed
I have a LED light, and my camera runs at 30fps. At each frame, I ant to know whet
I guess you cant just substract the two images to remove the noise, because there is always some movement with the camera....it cant be steady.....so u end up making a mess instead...
My call would be use "inrange" function, if a pixel is fully bright, i.e. 255 or say above 200, leave it as it is otherwise just make it zero..... thus you end up with just the led part...background gone!!
if the background is just noisy, but does not change so much you can you backgroudn subtraction:
you have 2 frames, and you do Frame2-Frame1, then you apply a threshold (the value of the threshold depends on the intensity of the LED so you should test it), and you set to black the pixles lower than the threshold and to white the pixels higher than the threshold.
this is very easy if you convert your image in a grayscale one.
should be somenthign like this:
cvAbsDiff(img2, img1, img2);
cvThreshold(img2, img2, (double)threshold_value, 255 (if you are using an rgb image), CV_THRESH_BINARY);
if your led is off you should fine just noise, while if you led is on you will expect to find a white region where your light is illuminting.