B.
Back to projects

Decision Review System for Cricket

3D movable plots of ball trajectory

A system I built to emulate the Decision Review Systems used in Professional Cricket. It consists of two sub-systems: the first is a computer vision system that can reconstruct the 3D path of a cricket ball and predict where it goes for LBW appeals, whereas the second sub-system emulates Edge Detection.

What it does

  • For LBW Reviews:
    • Identifies and tracks ball in 3D space by synthesising 2 camera inputs
    • Predicts the path of the ball when occluded or after striking pad
    • Detects if ball has bounced and estimates its pitch location
    • Compiles tracking data, user identified impact frame, ball pitching coordinates into a view to give decision on the LBW review
  • For Edge Detection Reviews:
    • Stitches 2 cameras and a microphone
    • Slows down inputs by a uniform rate and then generates waveforms to create an edge detector
    • Outputs into a processed video using FFMPEG

Why it’s interesting

The project combined noisy real-world data to track a small fast-moving object from noisy videos. It combined multi-camera 3D triangulation, a custom Kalman filter with nearest-neighbour data association and audio-based edge detection. I achieved an accuracy of within ±3.5cm (roughly half a cricket-ball’s width). This showcases how I can work with real-world, messy signals to get clean outputs.

Key Technical Points

  • Ball identification: Used multiple tools including colour segmentation and background subtraction. For colour segmentation, I experimented with multiple colour spaces including RGB, LAB, HSL and YCrCb. I ended up choosing YCrCb because it allowed me to isolate the ball’s colour from changes in the sun’s brightness.
  • Handling Occlusions & Final prediction: Implemented a Kalman Filter algorithm from first principles in Python. I then set the Kalman Filter up with basic Kinematic equations and experimentally tuned error covariances. I used the nearest contour to the prediction that met all other criteria as the input to the Kalman Filter (Nearest Neighbour Data Association).
  • Handling bounce: Used Normalised Innovation Squared (NIS) with Chi-Squared hypothesis testing and if the NIS fell beyond a threshold for a certain number of frames I would reset the Kalman Filter. This worked perfectly for resetting after a bounce or if the tracking repeatedly didn’t sync up with the ball.
  • Visualisation & output: 3D trajectories rendered with Matplotlib and final video assembled via FFMPEG.
  • Performance: Validated tracking accuracy against ground truth, showing a mean Euclidean error of ≈3.5cm with a standard deviation of ~0.007m, demonstrating sub-ball-width precision despite motion blur and occlusions.

Tech Stack

Language: Python
Libraries: OpenCV, NumPy, scipy, Matplotlib