Lateef Jawando
← Back to Projects

Hooper Vision: Basketball AI Analytics

My university group dissertation: a computer vision system that analyses basketball footage using object detection, pose estimation, and tracking to automate stat keeping and officiating.

Final-year group dissertation at the University of Kent.

Computer VisionAISports AnalyticsDissertation

Python · OpenCV · Ultralytics YOLOv8 · YOLO pose · NumPy · Cloudflare R2 · pytest

Hooper Vision: Basketball AI Analytics screenshot

Overview

Hooper Vision was my final-year group dissertation at the University of Kent: a computer vision system that analyses basketball footage to automate stat keeping and officiating. It detects players, the ball, and the rim using a custom-trained YOLOv8 model, tracks shooting attempts, flags double dribble violations, and gives players feedback to improve their skills. Professional basketball analytics relies on expensive multi-camera setups and proprietary tracking systems, so we wanted to see how far a single-camera setup with open-source tooling could get.

Training a custom detection model

I entered the project with no prior computer vision experience. The out-of-the-box COCO-trained YOLOv8 models proved insufficient: the generic "sports ball" class performed poorly on basketball footage and no "rim" class existed at all. I worked through the Ultralytics training pipeline and sourced domain-specific labelled datasets to train a custom model for players, ball, and rim.

Tracking: frame subsampling vs Kalman filters

YOLO detects objects per frame, but analysis requires linking detections across time. I implemented a frame subsampling optimisation that runs the detector on every third frame and reuses detections for intermediate frames. Before committing to that, I evaluated SORT-style Kalman filter tracking as an alternative. Testing showed the Kalman filter's linear constant-velocity model did not suit basketball footage since players change direction abruptly, causing bounding boxes to overshoot their targets. The simpler frame sampling approach was more predictable and produced better-looking output. I also exposed the trade-off directly to users with an option for full per-frame analysis, letting them choose speed or quality.

The speed estimation experiment

I implemented player speed estimation using bounding box height as a proxy for real-world scale, converting pixel displacement between frames into kilometres per hour. Testing exposed the flaw: a single calibration from the first detected player produced wildly inaccurate estimates for players at different depths, due to perspective effects. Rather than treating this as a failure, I documented the causes and specified what a proper solution would require: a homography mapping image coordinates onto real court coordinates. That analysis shaped the future work section of our group report.

Shot and dribble detection

Shot detection uses a heuristic approach: when the ball trajectory shows an upward arc followed by a downward arc near the rim region, it is flagged as a shot attempt. Dribble counting uses the ball's vertical position over time; a dribble produces a characteristic bounce signature detectable with peak-finding on the y-coordinate time series, which is what enables double dribble detection.

Evaluation

The project achieved its core goal, but the system remains closer to a strong prototype than a complete officiating and coaching tool. Accurate per-player statistics would need more robust tracking through court calibration and validation across camera angles. Several features are still missing: reliable speed estimation, interception tracking, rebound detection, assists, and possession changes.

The non-technical lessons were just as valuable: define a narrow initial scope with ambitious features as explicit stretch goals; don't invest in deployment configuration before the core system is stable and make passing tests a merge requirement rather than an afterthought.

Links