Hi, I am trying to create a robot that can detect and retrieve tennis balls. Should I use a camera and any tips on the programming?
-Thanks
Would this http://cmucam.org/projects/cmucam5 work?
Or would this VC0706 Camera Module DIY Guide - Blog be better.
CongMingRen:
Would this http://cmucam.org/projects/cmucam5 work?
CongMingRen:
Or would this VC0706 Camera Module DIY Guide - Blog be better.
I think the CMUcam 5 (aka Pixy) would likely be easier to use.
I've used the Pixy and it's really picky about lighting.
Where do you want to use this robot? What other things will be on the ground? What sort of lighting will be used?
Does the camera have to be on the robot?
Another possible option is a Raspberry Pi with its camera.
There was a recent thread about tracking objects. I'll try to find it and add a link.
I will be using the robot outdoors mainly. Even at night the tennis courts are usually well lit.
The ground at some courts may be green so would the ball be detected?
Yes, the camera needs to be on the robot.
How sensitive is the Pixy and what do u think about the other link?
Could it be possible to have the Pixy recognize the tennis ball in different lightings to make it easier to detect the ball?
Thanks Duane Degn
Also, the Pixy has a high cost ~$70.
Do you know where or how together a cheaper one?
Thanks again
CongMingRen:
Also, the Pixy has a high cost ~$70.
Do you know where or how together a cheaper one?
Thanks again
Considering what it is, and what it can do - that's a very low price. Just a bit of perspective. You are likely not going to find a cheaper option, already assembled.
If you got a Raspberry Pi B/B+/2 (not the Zero - even if you could find one, it doesn't have the proper connector) - and a camera module - you'd be most of the way to the Pixy in cost - and you'd still have to write your own "firmware" for the thing (like using Python and OpenCV with Python wrappers). Then debug it, etc.
Ok, thanks for the info. Do u think the second link I posted would work?
Hi everyone,
I also have a question on what motors i will need. The robot will be about 20lbs.
It will need to be heavy enough collect the balls using something like this:
Any suggestions on what type of motor?
Thanks in advance.
CongMingRen:
Ok, thanks for the info. Do u think the second link I posted would work?
Not likely, since that camera module outputs a JPEG image - there is no way you can get an Arduino to decode that image at any kind of speed to be useful (nor any place to put the decoded image).
Again - the Pixy is most likely going to be your lowest cost option.
I can think of one other possibility - if you could get ahold of one of those Raspberry Pi Zeros (good luck with that, btw) - then interface that camera module to the GPIO pins of the Pi - you might then be able to transfer the JPEG captured image to the Pi, then use OpenCV and Python to decode and process it (plus do all of the other image recognition stuff).
That would get your cost down below $30.00 USD - but you would need to do a lot of work on the software side. Further, I am not sure how long or how fast that module could transfer the image to the Pi; if you could find an equivalent module that used SPI instead of TTL serial, that would be better (not the most ideal, but much better).
I agree with cr0sh about not wanting to use a JPEG camera. I'm not sure I'm convinced the Pixy would be the best option. It has been my experience, the Pixy requires tightly controlled lighting conditions.
It is very likely tennis balls could be detected an ultrasound sensor. A forward facing ultrasound sensor mounted an inch or so above the ground should have a good chance of finding tennis balls. At such a shallow angle, the ultrasound echo would normally bounce away from the sensor but a tennis ball would likely direct the echo back to the sensor.
Here's the link to the "motion tracker" thread I mentioned earlier.
If I were to try to make a device to detect tennis balls, I'd probably use a laser projected as a line a few feet in front of the robot. A black and white camera a couple inches above or below this laser would monitor this line and watch for deflections of the line indicating a ball has been spotted.
As I showed in the other thread (and I'll post it again here (because I think it's a cool picture)), the LED array shown in the picture below is displaying what is seen by the camera held in my fingers in the top left of the photo.
Can you see the "HI" from the white board displayed on the LED array? The array is displaying a lower resolution image than the one being captured from the black and white camera.
I don't think it would be very hard to find a projected laser line in an image captured with this sort of setup. Once a "baseline" line were determined, the microcontroller could monitor the captured images for signs the line was passing across a tennis ball rather than producing a nice straight line on the ground.
Such a camera setup could possibly find tennis balls without a laser line as an aid. I'd think it should be possible to scan the captured image for a circular shapes. As I try to think of what sort of algorithm one would use to detect a circular shape the idea of using a projected laser line becomes more appealing. I don't think it would be very hard to come up with an algorithm to check if a laser line had been deflected by an obstacle or not.
This black and white camera example is the only "machine vision" experience where I had access to the raw pixel data. My other dabblings with machine vision where with high level solutions like the Pixy. IMO, there's something very appealing about having access to the raw pixel data. These other possible solutions which would allow one access to these raw pixels. These other solutions also involve relatively low resolution cameras.
The example I shared above wouldn't necessarily save you much money. IIRC the little B&W camera cost $20 and the 8-bit parallel ADC chip used to capture the image cost about $11. I don't think the low end Arduinos would be fast enough to capture the video using the 8-bit ADC chip. You'd likely need to use one of faster Arduinos.
I still think there may be some simple solution without a need to use machine vision.
you could have 2 robots with a net in between. This net should be in a slight V shape and the balls would be collected quite fast - at least in my imagination
bit like Boyan Slat wants to do with the plastic soup - http://www.theoceancleanup.com/