Machine Vision Basketball Shot Analysis Using a Mobile Phone
In the undergrad, a good friend of mine and I built an Android App that uses the camera on your phone to watch you shoot a basketball, and provides audio feedback on how you're shooting.
The app works by detecting the moving ball in the screen, and tracking it over multiple frames. Each time it gets a 'successful track' it draws a green circle on the frame where the ball was tracked. Then once it detects a peak, it uses quadratic regression to predict the path of the ball -- so it actually can predict the shot position and angle before the ball makes it to the hoop. You can see the quadratic line it draws as the white line in the video.
Once the ball makes it to the hoop, the app uses text-to-speech to 'call out' the angle of the shot. That way solo shooters can practice on their own, with the phone providing instant audio feedback to help them perfect their shots.
We designed and coded the detection algorithm to be robust to color of ball and background, so the app works well indoors or out without any changes from the user. You can see from the screenshots how it's able to get good track points even over the bright lights, and it can see the ball against the sky, the ceiling or the wall. In fact, in one of the scenes in the youtube video above we even used a green/white ball just to check -- and it worked flawlessly!
The app is free Here on the Google Play store.