Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Tracking Ball with Camera (http://www.chiefdelphi.com/forums/showthread.php?t=82473)

guoruiwu1994 12-02-2010 11:50

Tracking Ball with Camera
 
Does anyone know any good ways to track the balls with the camera? From reading the forums, I see that a good way is to see where the carpet is missing, and then just assume that's where the ball is. However, we don't know which classes and funtions to use in order to achieve this. If anyone can help us on this that would be great.

DavidGitz 12-02-2010 12:50

Re: Tracking Ball with Camera
 
Quote:

Originally Posted by guoruiwu1994 (Post 918543)
From reading the forums, I see that a good way is to see where the carpet is missing, and then just assume that's where the ball is. However, we don't know which classes and funtions to use in order to achieve this. If anyone can help us on this that would be great.


We were originally going to try this method, but due to other objects on the field like robots and the playing field, and having to deal with elements outside of the playing field that the camera would pick up, we deemed this not to be very practical. Unless of course your camera is pointed down sufficiently enough that these things wouldn't be an issue.

Instead our students implemented a normal circle tracking script tuned to the ball instead, reportedly it can track the ball while its even flying through the air (Not sure of the utility in this capability but this means it will work pretty reliably on the ground). I will upload the NI Vision script here so that other teams can tune it to their own needs.

Greg McKaskle 12-02-2010 17:24

Re: Tracking Ball with Camera
 
If they've achieved results that amazing, they must have implemented one of those CSI filters the policemen use on TV all the time. Perhaps they can also zoom in and estimate the air pressure of the ball and determine which team's robot kicked it by using the shadows in the image :) .

The circle tracker will be quite slow, needs sharply defined edges, doesn't like shadows. The carpet technique sill be pretty fast and more resistant to blur. The key is to use some of the particle filters before you get the particle analysis and to look at some of the measurements that indicate how circular the particle is.

Note that this technique and the circle detection both need the camera to point downwards in order to be effective. This is pretty easy to verify simply by moving a ball around in front of the robot and viewing on the dashboard.

Greg McKaskle

guoruiwu1994 13-02-2010 09:16

Re: Tracking Ball with Camera
 
detectEllipse seems to be a good one to use, however, I cannot find enough documentation on that, where would I put it, and would I have to declare anything?

ideasrule 13-02-2010 09:26

Re: Tracking Ball with Camera
 
Quote:

Originally Posted by guoruiwu1994 (Post 919149)
detectEllipse seems to be a good one to use, however, I cannot find enough documentation on that, where would I put it, and would I have to declare anything?

I've fiddled with detectEllipse, and you're right, the documentation is lacking. If you open Vision Assistant and open the shape detection function, you'll understand what to put for *most* of the parameters. You can find more documentation in the Java library and in the nivision.h header file.

guoruiwu1994 13-02-2010 10:47

Re: Tracking Ball with Camera
 
I tried opening up Vision Assistant on the provided Classmate PC, however, I wouldn't work the error message said that the screen resolution is too low. Also, there is no VGA plug to plug in another monitor. Is there a way to stop the screen resolution check?

guoruiwu1994 13-02-2010 11:03

Re: Tracking Ball with Camera
 
We are using Netbeans to program the robot, how would I get this working under Netbeans?

joxphoto 17-02-2010 01:40

Re: Tracking Ball with Camera
 
Quote:

Originally Posted by guoruiwu1994 (Post 919200)
I tried opening up Vision Assistant on the provided Classmate PC, however, I wouldn't work the error message said that the screen resolution is too low. Also, there is no VGA plug to plug in another monitor. Is there a way to stop the screen resolution check?

-----------

You can increase the screen resolution to the maximum (1024 x 768, if I'm not mistaken). The tradeoff is that your "workarea" will be slightly bigger than the screen, thus, "panning" effect will be experienced when going from edge-to-edge of the screen.

If you have another computer to use, I suggest installing the Vision Assistant there, create all your scripts and maybe generate some code, then deploy those to your Classmate.

We've done both methods and both work reliably.


All times are GMT -5. The time now is 09:10.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi