Say hello
← All work

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.

Height of the ball in the picture over time. Between touches it follows a smooth arc;net bounces are the sharp V’s over the net,touches are kinks anywhere else. Click to jump.

How it works

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Net bounce: falling, then rising, over the net.
Touch: a kink the arc of gravity can’t explain.
Ground: falls away from the net and dies.

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, 2025Spikeref, 2026
Rallies foundstart and end only17 of 18 (1 extra)
Rally start within 0.2 s76%83%
Rally end within 0.2 s80%22%
Net bounces (F1)0.770.80
Player touches (F1)0.340.80
Point winner correctnot scored14 of 18
Speed30 fps300 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).

Download Spikeref ↓

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