AForge.NET

  :: AForge.NET Framework :: Articles :: Forums ::

Following light in a video

The forum is to discuss topics related to different areas of image processing and computer vision.

Following light in a video

Postby john.s.haddad » Tue Nov 21, 2017 12:33 am

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!
john.s.haddad
 
Posts: 3
Joined: Tue Nov 21, 2017 12:28 am

Re: Following light in a video

Postby andrew.kirillov » Tue Nov 21, 2017 9:00 am

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.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3404
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Following light in a video

Postby john.s.haddad » Tue Nov 21, 2017 5:34 pm

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.
john.s.haddad
 
Posts: 3
Joined: Tue Nov 21, 2017 12:28 am

Re: Following light in a video

Postby andrew.kirillov » Tue Nov 21, 2017 9:15 pm

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.
With best regards,
Andrew


Interested in supporting AForge.NET Framework?
User avatar
andrew.kirillov
Site Admin, AForge.NET Developer
 
Posts: 3404
Joined: Fri Jan 23, 2009 9:12 am
Location: UK

Re: Following light in a video

Postby john.s.haddad » Wed Nov 22, 2017 12:54 am

Thanks!
john.s.haddad
 
Posts: 3
Joined: Tue Nov 21, 2017 12:28 am

Re: Following light in a video

Postby Zak Mistry » Tue May 08, 2018 7:07 am

I got carried away trying sample, great really!
Zak Mistry
 
Posts: 3
Joined: Mon May 07, 2018 1:10 pm




Return to Image Processing and Computer Vision

cron