Final-year project · computer vision
A referee for Spikeball.
Put a phone on a tripod next to the net. Spikeref clips every rally on its own, asks if you want to keep it, keeps the score and points out faults. It started as my skripsie in 2025; this is the rebuilt version.
Watch it work ↓Download Spikeref ↓
- When
- 2025 – 2026
- Role
- Final-year project, BEng Mechatronic Engineering
- Tools
- Python, OpenCV, NumPy
Watch it referee
Real rallies from a backyard game. Everything drawn on the video is what the detector worked out on its own: the ball, where it touched the net, and when the rally started and ended.
How it works
- 01
Find the ball
Every frame, pixels in the ball’s colour become blobs, scored on size, roundness and motion. Anything ball-coloured that never moves (jeans, a bag) is learnt as background.
- 02
Follow it
Between touches the ball is a projectile, so the tracker predicts where gravity will take it and looks there. A second track watches the best flying blob and takes over if the first one latched onto a hand.
- 03
Read the path
Velocity only changes by gravity unless something hits the ball. Falling then rising over the net is a net bounce; a sharp kink anywhere else is a touch; falling and dying away from the net is the ground.
- 04
Cut the rally
A rally opens on a fast net bounce right after a serve and closes when the ball dies or nobody returns it. The last 40 seconds stay in memory, so the clip includes the serve.
- 05
Keep score
The serving team makes net bounce 1, the receivers bounce 2, and so on. The point goes to whoever made the last clean bounce, unless it hit the rim. You confirm with one key.
Then and now
Both versions measured on the same hand-labelled 167-second game: 18 rallies, 27 net bounces and 60 touches marked by hand.
| Skripsie, 2025 | Spikeref, 2026 | |
|---|---|---|
| Rallies found | start and end only | 17 of 18 (1 extra) |
| Rally start within 0.2 s | 76% | 83% |
| Rally end within 0.2 s | 80% | 22% |
| Net bounces (F1) | 0.77 | 0.80 |
| Player touches (F1) | 0.34 | 0.80 |
| Point winner correct | not scored | 14 of 18 |
| Speed | 30 fps | 300 fps |
Rally ends are the weak spot: the exact moment the ball lands in the grass is hard to see, so an end can be up to a second off. Clips keep a second extra so nothing gets cut. It has been measured on one labelled game so far, filmed from about 2 m at 45° to the net.
Use it yourself
It runs on a laptop with any webcam, or an iPhone through Continuity Camera. Calibrating takes about 15 seconds: click around the net’s rim, then circle the ball. After that you just play. Free to use and change (MIT licence).
pip install -r requirements.txt
# a recorded game
python -m spikeref analyse game.mp4 --overlay
# live, with the save prompt
python -m spikeref live --camera 1
# the games and highlights page
python -m spikeref view