Automatic Basketball Shooting Trajectory Analysis

CSEF · 2018 Computational Systems & Analysis

Overview

Objectives/Goals The objective of the project is to build a system to detect the basketball trajectory and provide feedback of the incident angle to the shooter. Methods/Materials I bought a stereo camera kit and built a custom frame to mount it. This allowed me to use a baseline of 39 cm which is much wider than most of the commercially available stereo cameras. I developed my programs on Intel i7 based PCs using C++ and OpenCV library. I used the functions in the OpenCV library to calibrate my stereo camera. I evaluated many different object detecting techniques, and found that cascade detectors had the most promise in addressing my needs. I created an image library and annotated the sample images to train my own cascade models. I used cascade detectors to detect the backboard, rim, and basketball. I developed a custom algorithm to fine-tune the basketball location in the image. By using the reprojection matrix of the stereo camera, I could use the detected pixel coordinates from left and right images to find the basketball position in 3D space. I then wrote a program to collect all the sample basketball positions in the trajectory frame-by-frame, and fitted the samples to a parabola that minimized square errors. The parabola had the best fit to the projectile trajectory, and the incident angle can be derived from the parabola formula. Results I found that it was important to group foreground samples with different shot angles. The most critical factor was using the LBP (local binary patterns) feature type instead of the default HAAR feature type in training cascade models. After training the cascade models with LBP feature type, my program was able to detect the backboard, rim, and basketball. The RMS (root mean square) error of the trajectory detected by the stereo vision was about 7.4 cm at a distance of 7.9 m. I was able to fit the detected trajectory to a parabola and estimated the incident angle. Conclusions/Discussion Cascade models with LBP feature type were used to automatically detect the camera location relative to the backboard and rim, and detect the basketball trajectory. The trajectory was fitted to a parabola in order to estimate the incident angle for providing feedback to the shooter.

Summary statement

I have developed a system that can automatically detect the camera location on the court, detect the basketball trajectory in order to estimate the incident angle, and provide feedback to the shooter.

Help received

I wrote the programs and developed the algorithms myself. I used the OpenCV library extensively. I found answers through web searches for most of my programming questions.

Competition history

  • CSEF 2018 Computational Systems & Analysis · Entry S0806

Resources

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: California Science & Engineering Fair public projects

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google