Page 1 of 1

Following light in a video

PostPosted: Tue Nov 21, 2017 12:33 am
by john.s.haddad
I am trying to create an application on AForge that has a video stream from a camera, and infront of it I will be moving a led light. I want the application to follow that light and always make it at the center of the camera.

I am using an Arduino Uno with a Servo Motor connected to it, and on top of that Servo Motor I have my camera. I was thinking if I create a function that calculates the "angle" to send to my motor and make it move, whenever the light moves, to keep it at the center of the camera.

Any sample code/functions to use that might help? I have the Motion Detection sample off AForge site, but any samples for light detection? I also found this tutorial, but it does Motion Detector rather than Light Detection: http://myactivities-mazen.blogspot.ca/2 ... et-to.html

Any help would be appreciated, thanks!

Re: Following light in a video

PostPosted: Tue Nov 21, 2017 9:00 am
by andrew.kirillov
See this one. Different controller for servos, but should not matter - idea is the same. Ignore the fact it uses two cameras - it is just to make it look cooler, but not required at all.

Re: Following light in a video

PostPosted: Tue Nov 21, 2017 5:34 pm
by john.s.haddad
Amazing, thanks for the sample! Will need to adjust it to work on Arduino and should be fine. Would light be the same as "color" tracking? Will check if the LED has a specified color then it makes it easier, otherwise please let me know if light tracking could be done using a different function that is more suitable.

Re: Following light in a video

PostPosted: Tue Nov 21, 2017 9:15 pm
by andrew.kirillov
john.s.haddad wrote:to work on Arduino

It will not work on Arduino. It can work with it, but not on the Arduino itself. You will need to guide Arduino using serial communication, for example.

john.s.haddad wrote:Would light be the same as "color" tracking?

Your lights may have certain color, which you may try tracking.

Re: Following light in a video

PostPosted: Wed Nov 22, 2017 12:54 am
by john.s.haddad
Thanks!

Re: Following light in a video

PostPosted: Tue May 08, 2018 7:07 am
by Zak Mistry
I got carried away trying sample, great really!