Catching the Ball

 Catching the Ball To catch the ball we had to position the plate that the camera sits on, a 3.5” wide platform so that the ball would land within its edges.  On screen we are able to determine an X position of the ball as well as a radius.  Since the image is 320 pixels wide, an X value greater than 160 means the ball is right of the camera, and anything less means the ball is left of the camera.  Now, if the ball has a smaller radius, that means the ball is farther away from the camera, than if the radius is large, and the ball is close to the camera.  Knowing these two values can help us guess where the ball is relative to the camera.  If the ball is P pixels away from 160 and has a radius of 10 (far away) versus (50) close we would want to move proportionally future for the radius of 10, than the radius of 50, because the ball is probably situated further out.  To imagine this, think about when you look down a long stretch of highway.  The further you see the closer both sides of the roads come to converging to one point.  So, if at the very end of your vision, where the road is perceptively more narrow than in front of you, you have see something that looks like it is one inch to you right, is it actually one inch?  No, since you are far this is only an illusion, and it is much more than one inch to your right.  Now, if you are looking at some object one foot in front of you, and it looks like it is one inch to your right, odds are it is very close to one inch to your right. When testing the apparatus, we considered a catch to be when the ball comes in contact with the platform on which the camera is situated. Testing was done by rolling the ball up the ramp and see if the platform could make contact with the ball when it rolled back down. If the ball rolled off a side of the ramp, but the camera moves full towards that side, that would be considered a catch as well. Our device was able to catch the ball with around 70-80% accuracy. The reason for not 100% accuracy is because of speed. Faster ball movements induce blur into the webcam image which causes it to try and process the image on full, which is the slowest mode. As a result, sometimes it might not pick up a valid signal until too late. However, understatic testing, the machine is able to deduce where the ball is with almost 100% accuracy. The misses only occur when the ball is very far away from the camera and the radius becomes too small.