Best way to find the position of a (foosball) ball?

Martin

Lifer
Jan 15, 2000
29,178
1
81
First off, I assume everyone knows what foosball is.

If I want to where the ball is at any point in time, what would be the best way to do that?

1. Visual recognition - having an overhead camera and a ball coloured so that it stands out. A computer processes the images and then gets the location of the ball.
--concerns: By my estimations a good good shot can go at about 25m/s and the space between the offence and goalie is about 0.25-0.3 meters, which means that in order to have any chance at saving, the entire process of "get image, process it, get position" would have to take a less than 10miliseconds. That means the camera must be able to capture upwards of 250fps.
--questions: are there semi-commercial cameras that have such high capture rates? would a software or a hardware (FPGA) solution be better in terms of speed?

2. Radio Transmision: The would involve a small transmitter inside the ball and 3 transmitters to triangulate (correct term?) to pin point the location
--concerns: I know next to nothing about radio transmission and receiving. is this method even possible? are there radio transmitters so small as to fit in a ball? Are there transmitters tough enough to withstand hitting a wall at 25m/s?
--questions: Would this be any faster than a camera? I would think that getting the position of the ball would be much much quicker than with a camera...but I don't know.

3. radar: I was thinking perhaps coating the surface of the ball (and the players' feet) with some kind of metal spray or perhaps embedding some metal in the ball/feet, than using radar-like tech to find the postion.
--concerns: I think Radar woudl be a bit too highly technical for this, plus I don't know if its well suited to this....

Anyway, if anyone can answer my questions or provide some insight, it would be greatly appreciated.
 

AbsolutDealage

Platinum Member
Dec 20, 2002
2,675
0
0
What kind of project is this for? Engineering class, or personal project?

I would say that out of the 3 choices I would have to go with the camera. To make it easier, you should make the ball a completely contrasting color from the players/field, and then filter your camera and adjust the contrast so that the ball is going to be very easy to spot. I am not aware of a specific camera that you could use, but if your estimate is 250fps it is not going to be cheap. I'm sure you can do some research on it or you can find someone here who knows more about it than I do.

What is the overall point of this? If you are trying to create an automated opponent on the table, your biggest problem is not spotting the ball. That calculation time will be trivial compared to the time it takes to actually move the players (unless you have some really hefty motors on those poles).

In any case, good luck.
 

sgtroyer

Member
Feb 14, 2000
94
0
0
So you're trying to create a computer controlled goalie? Cool project. I would say 2 and 3 either won't work, or would be ridiculously complicated. 1 will likely work, but like you said, you need a high capture rate, and very low latency to work.

If you can make a hardware or DSP solution work, that's going to have lower latency, but I'm assuming the recognition algorithm will be pretty complicated. Once you recognize the ball and can assign it a position, the rest is easy, just take the difference in two successive positions to get a vector, and locate the goalie on that vector.

Using a computer gives you much more software complexity, but I don't know if you can afford the latency.

This is a complicated one.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Do you really need that high of a framerate? I think you won't be able to accelerate the goalie fast enough that it would matter, if the ball came that fast from that range.
 

sciencewhiz

Diamond Member
Jun 30, 2000
5,885
8
81
One of the senior design projects at my school was to make a goalie for air hockey. I beleive they used magnetic sensors underneath the surface and a special puck. When I get a chance, I'll look for their webpage with all the details.

Edit: OK, I was wrong, they used photo sensors, which probably wouldn't work for your situation, since there is a lot of "stuff" in the foosball table. Anyway, here is the link. It's still interesting: http://www.ee.rit.edu/oldsite/srdesign/web_page/year00/M/
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
On one of the projects I worked on last summer in a neuro lab, they wanted to do motion capture on some subjects, and they had a multi-camera setup for it. Those cameras operated at high speeds (I think they were like 100fps, but they make faster ones), and used infrared illuminators to get very high contrast on reflective targets (you could just paint the ball with something that's IR reflective). Since you're interested in a 2D field, you'd only need 1 camera. It might cost a few grand, but it would probably work. You may not be able to get fast enough to accurately block 25 m/s shots, but hey -- I can't do that reliably either. :)

Here's a link to the sort of thing you'd be looking at -- don't know how much these cost, but they claim to do 1300x1300 @ 500fps (and faster if the resolution is lower). You'd need a dedicated hardware capture board to go with them.

http://www.compumodules.com/image-processing/high-speed-cmos.shtml

It's worth noting that option #2 is basically what Fox did for their hockey-puck-tracking system a few years back (FoxTrax was the name, I think). It works, but I believe they used about a dozen sensors to triangulate the position more accurately, and a whole truckload of computers to crunch the numbers and figure out where it was relative to the cameras in real-time. Since hockey pucks get batted around quite a bit, I'd assume they found some crash-proof transmitters somewhere. I would think that the hardware to do this would be even more expensive than option #1, though.
 

grant2

Golden Member
May 23, 2001
1,165
23
81
A computer controlled foosball opponent HAS been developed; I saw a video clip of it scoring on a human player.

If possible, I recommend adding a ferrous or magnetic material to the ball; this will change its characteristics but so will adding a radio transmitter. A detection grid on the playing surface can then track the ball's position.
 

Sahakiel

Golden Member
Oct 19, 2001
1,746
0
86
Why don't you just add an array of IR sensors to the table? Very cheap and low-tech, but it would probably work.
 

Martin

Lifer
Jan 15, 2000
29,178
1
81
Thanks for the help. Some more info: I'm in 2nd year ECE and I am tired of math and other theoretical stuff. I want to actually build something and I don't want to wait until my 4th year design project to do so. This is still an idea that I'm thinking about and have floated to a few friends (foosball fanatics like me). The project would extra curricular, not personal. We would aim for having company sponsorship (say, bonzini could donate a table) and some faculty support. There's lots of other similar projects (solar car, robocup, battle bots etc), so I fgure there's a decent chance of getting this thing started, if we come up with a technically sound plan.

The project would be creating not just a computer controlled goalie, but a computer controlled opponent playing on all four bars. Since there are no size, weight or power considerations we could use some very powerful motors to move the players. In the goalie's case, he'd only have to move ~6cm. If we can't find motor that can provide the acceleration needed, then perhaps we could use electromagnets (correct me if I am wrong, but I've heard they might provide something like 10^6m/s^2 and we would only need 5000m/s^2 in the worst case scenario).

About the sensor, I did look at some high speed CMOS cameras and I think a QVGA camera at 450fps (like the one at www.siliconimaging.com) would do the job. If we use a good algorithm (for example, assume a maximum speed (say 25m/s), you know the time between shots (2.2ms @ 450fps), so you look only a few pixels around where the ball was last time).

Anyway, I am still not sure whether this idea's too complex for us and whether we could complete it (our timetable would be 2-3 years doing it as a side project). All I want to do for now is come up with a good plan and then discuss it with a prof, since we would need guidance and supervision.

Btw, if you guys have any good ideas, please let me hear them :)
 

Martin

Lifer
Jan 15, 2000
29,178
1
81
Originally posted by: grant2
A computer controlled foosball opponent HAS been developed; I saw a video clip of it scoring on a human player.

If possible, I recommend adding a ferrous or magnetic material to the ball; this will change its characteristics but so will adding a radio transmitter. A detection grid on the playing surface can then track the ball's position.

Could you please elaborate on your idea? What kind of sensors would this need?

Yeah, this is not an original idea. I first saw this on Slashdot http://www.informatik.uni-freiburg.de/~kiro/english/

In this case, I just want to build a better one. If you read through their PDF, KiRo can only beat amateurs and cannot really beat advanced players without lots of luck (it seems to be fastball only)
 

grant2

Golden Member
May 23, 2001
1,165
23
81
Originally posted by: MartyTheManiak
Could you please elaborate on your idea? What kind of sensors would this need?

magnetic sensors? :) I'm not really an engineer :)

Yes the link you provided is the table i'm talking about. They used cameras which suggests it's one of the best methods.
 

Matthias99

Diamond Member
Oct 7, 2003
8,808
0
0
Nothing, but presumably you would calculate the intended position and use something similar to a servomotor control circuit to drive it to the right place, or build an open-loop feedback design so the goalie will continuously track the ball.