|
Tennis ball finder? from United States [214 posts] |
16 year
|
Hello,
I'm trying to use RoboRealm to detect tennis balls in an image. My robot uses a wireless video cam to beam back the image to my main computer where I am running RR. Ordinarily I would use a green RGB filter to start things off. However, I am using a wide angle lens on the camera that washes out the color. So I'm thinking I'm going to have use shape and size information instead. Could someone get me started on the right track?
I've attached a sample raw image of two tennis balls. I've also attached the same image filtered through the Sobel Edge filter which seems to put some good outlines on the two balls. However, I really don't know how to go from here.
Thanks!
patrick
|
|
|
Anonymous |
16 year
|
patrick,
You're on the right track with the edge detection, after that the circles module should be able to find the balls as long as they are round. We've added a script that does just that below. Note that it detectes another circle around the bicycle tires but that can be eliminated by simple thresholding as the tennis balls are much lighter.
The final image looks like
The attached robo file includes the image so you should be able to load it in RoboRealm and play with the values a little to understand how they affect the results.
STeven. program.robo
|
|
|
from United States [214 posts] |
16 year
|
Hi STeven,
Many thanks for the cool solution! I never would have thought of using the DoB edge filter since the result looks so complex at first. While your .robo file works great for a single frame, I find that circles bounce around a lot when processing a live video stream, and there are many spurious circles that require different parameters to eliminate for each frame. I tried using the flicker filter to calm things down but it didn't solve the problem. I think the real solution is just to get a wide angle lens/camera combo that doesn't wash out the colors--using a green filter on a normally colored image works very well to detect the balls.
--patrick
|
|
|
Anonymous |
16 year
|
Patrick,
Agreed ... color is easier to use.
But, can you post a couple of the other images (or a short video) that we can test out as it would be nice for others that have similar problems to know what a good solution might look like. The circles will bounce around at lot due to camera noise which can be reduced using frame averaging/bluring techniques. This is something that you might try, i.e. add a mean filter of about size 5-10 and see if that helps to stabilize the edges. Normally mean filtering is part of the edge detection which is built into some edge detectors (like Canny) but needs to be added in front of Sobel, DOB, etc.
STeven.
|
|
|
from United States [214 posts] |
16 year
|
Hi STeven,
For some reason, the image seems more stable today. And applying a mean filter seems to help a bit. I'm attaching a 2 second AVI video with two tennis balls in the foreground (nothing is moving). Hopefully this isn't too big (about 2 Mb). Let me know if you need something longer.
--patrick
|
|
|
from United States [214 posts] |
16 year
|
|