How computer vision ball tracking works in sports apps

By Awais Chaudhry, 13 November 2026

Tracking a ball in sports video looks simple on broadcast TV. On a phone filming a padel or tennis match, it is one of the harder problems in computer vision: the object is tiny, fast, often blurred, and regularly hidden behind players or the net. We built a padel ball-tracking app, and this is how such systems work.

Layer one: detection

A detection model looks at each frame and outputs boxes around anything it recognises as a ball, each with a confidence score. Modern detectors from the YOLO family are a common starting point because they run fast enough for real time. Out of the box they are trained on general images, so they need fine-tuning on footage from the real setting: your courts, your lighting, your camera angles.

Small objects are the main difficulty. A ball may cover only a few pixels, so we often run the detector at higher resolution, or on crops around where the ball is expected, and we feed it a short stack of frames so motion helps separate the ball from similar-looking background.

Layer two: tracking

Detections on their own flicker. The model misses the ball in some frames and mistakes a white shoe for it in others. A tracker joins detections across frames into one path. Classic tools such as the Kalman filter predict where the ball should be next from its recent motion, then match the next detection to that prediction. When the ball disappears behind a player, the tracker keeps predicting for a few frames instead of giving up.

Layer three: court geometry

Pixels are not metres. To report where a shot landed or how fast it travelled, the app needs to map the image onto the real court. Because court lines have known dimensions, we can detect them and compute a homography, a transformation from image positions to positions on the court floor. With that in place, the app can place bounces on a court diagram and estimate speed from distance over time.

Running it on a phone

Players want results at the court, not hours later. That means compressing models and running them with Core ML on iOS or TensorFlow Lite on Android. We trade a little accuracy for speed, then recover some of it with the tracker, which smooths out the frames where the model is unsure.

Where these systems still struggle

  • Night games under uneven lighting
  • Cameras that move or zoom during play
  • Glass walls in padel, which create reflections that look like a second ball

Each needs targeted training data and testing, which is why we agree accuracy targets with clients up front and measure them on footage the model has never seen.

Building something similar for sport, manufacturing or agriculture? See our computer vision service or tell us about your project.