Society of Robots - Robot Forum

Software => Software => Topic started by: lildude8572 on April 20, 2008, 12:35:35 PM

Title: Image processing for Ball tracking
Post by: lildude8572 on April 20, 2008, 12:35:35 PM
Hi all,
hope you can be helpful for this one.

We are building a robot which will track a ball down.  For it my task is to do image processing and finding the balls position and output its position details in terms of x and y coordinates.

As of now I am planning to use matlab for this and then convert the program in c.
Can you guys suggest me some ideas for the algorithm as to how should I find the ball position, for eg. look at balls size etc.

Note that the camera will have omnivision.

Thank you in advance.
Hope to hear from you soon  :)
Title: Re: Image processing for Ball tracking
Post by: Steve Joblin on April 20, 2008, 12:39:06 PM
Have you looked at RoboRealm?  they have a great tutorial on how to track a colored ball... it is very easy to use, and best of all, it is free software!

homepage... http://www.roborealm.com (http://www.roborealm.com)

turorial on object tracking... http://www.roborealm.com/tutorial/color_object_tracking_2/slide010.php (http://www.roborealm.com/tutorial/color_object_tracking_2/slide010.php)
Title: Re: Image processing for Ball tracking
Post by: lildude8572 on April 20, 2008, 12:50:16 PM
Hi Steve,

Thank you for your promt reply.

Although Roborealm is a very good software for this application, we are not allowed to use these softwares since its a university project and we have to write our own algorithm.  First we are going to try on Matlab and than do the whole project in C ..
Please let me know about how I can go with this task.
Thank you once again
Title: Re: Image processing for Ball tracking
Post by: hgordon on April 20, 2008, 01:08:14 PM
What processor are you using with the Omnivision camera ?

Swarthmore College has a course using SRV-1 Blackfin image processing functions that have been supported in Matlab -
    http://www.swarthmore.edu/NatSci/mhsieh1/Courses/E28/
Title: Re: Image processing for Ball tracking
Post by: dunk on April 21, 2008, 12:39:13 PM
try searching for "blob detection"
or (better but *far* more processor intensive) "Hough transform".

the basic Hough transform will find straight lines but can be modified to find any shape.

dunk.
Title: Re: Image processing for Ball tracking
Post by: lildude8572 on April 22, 2008, 07:49:04 PM
Hi,
thank you all so much for your replies.

I have further questions regarding image processing for ball detection.  can you guys tell me if I should go for omnivision or regular vision which will see just the front view from the robot?which wil be better in terms of ease of processing and also is there a way to obtain omnivision by designing a dome kind of thing with mirrors and align the camera in such a way that it sees the complete picture (360 degree view).

thank you for your time :)
Title: Re: Image processing for Ball tracking
Post by: JesseWelling on April 22, 2008, 10:27:22 PM
I'd just go for a Pan/Tilt setup and a regular camera, or even just a Panning Servo.
[youtube]hBCUbmaOJtM[/youtube]
Title: Re: Image processing for Ball tracking
Post by: benji on April 24, 2008, 11:26:29 AM
yea Matlab has many image processing functions that can help u a lot,, all u have to do is check with the matlab help,,
image processing toolbox, read there about blop detection,,or anything that u think can help u, its all there in the help
i did work with matlab but not pretty much with image stuff,,makin this with c or c++ is like hell, matlab is much easier,its you best shot,
luck with your proj
Title: Re: Image processing for Ball tracking
Post by: Admin on April 26, 2008, 06:01:21 PM
hgordon, I think he meant 'omnivision' as in not 'binocular vision' :P
(It had me confused for a sec, too)

lildude8572, try this for a basic rundown:
http://www.societyofrobots.com/programming_computer_vision_tutorial.shtml
http://www.societyofrobots.com/programming_computer_vision_tutorial_pt3.shtml#middle_mass
Title: Re: Image processing for Ball tracking
Post by: lildude8572 on April 30, 2008, 12:31:43 PM
Thanks alot you guys..

I will look at ideas put forward here..

cheers  :)