com Computing Ltd Start a conversation
Case study

That Was Out, a line call from two phones

Sports tech, my own product. Built 26 to 28 November 2026.

Two phones on tripods, one on each sideline. When a point gets close you tap replay, watch it back from both angles, and the app draws where the ball landed and how far it was from the line.

I play pickleball and the arguments are always about the same thing, whether the ball was out. Hawk-Eye costs more than the court. So this is the cheap version: two phones on the same Wi-Fi, paired by a QR code, recording both angles into the host phone's browser. No account, no upload, the footage never leaves the court. A third phone can watch along.

The part that took the work is the call. A small neural network I trained finds the ball in every frame, a tracker follows it and works out the instant it hit the floor, and the replay then looks for the court's own painted lines in that frame so it can put the mark on a plan of the court and measure the gap in millimetres. Where it cannot find the court it uses the painted line as a ruler, because a two-inch line is foreshortened exactly the same as the gap beside it, and asks you which side the court is. Every distance comes with its give-or-take, and the app says when it is not sure. Claude reads the stills as a second opinion.

Everything on this page was measured on public match footage, credited on thatwasout.com ↗ and used for no profit. The numbers live as JSON next to the code, so a rerun either agrees with this page or shows where it moved.

0
Commits, 26 to 28 November 2026
0
Of 24 labelled bounces found, every one within 50 ms
0
Of 24 labelled calls got right, seven with no tap at all
0 KB
The ball model, run on the phone itself
The ball mark on a phone: the contact frame with the ball's trail, the mark, a 160 mm gauge to the baseline, the call Out beyond the End B baseline by about 160 mm, and the mark on a plan of the court.
The ball mark as it looks on the phone. The trail, the contact, the gap to the court's own baseline and the mark on the plan, with no setup. Footage: Pickleball Wanderers, Seattle.
§ 02

How it went, in order

Three days, in the order the problems turned up.

  1. 01

    Two phones and a replay button

    The first version was for friends at the next game, so it had to be a link rather than an app store. The host phone makes a one-use invitation, the second phone scans it and streams its camera over WebRTC on the court's own Wi-Fi or a hotspot. A small Node service on Railway does the introductions and then gets out of the way. The host records both angles into its browser, and replay last point closes the point, starts the next one and opens the pair. Pause, slow motion and frame stepping move both views together. A finished game exports as a ZIP.

    Out: a two-angle replay on the court, no account, no upload.

  2. 02

    Teaching a phone to see the ball

    A pickleball is small, fast and often the same colour as the lines. I trained a small convolutional network to produce a heatmap of likely ball centres from 1,947 labelled frames and 10,410 crops, exported it as a 35 KB ONNX file and ran it in a web worker on the phone while it records. The tracker on top checks motion, colour and continuity, and in replay it keeps a rival chain, so a track that has parked on a yellow shoe gives way to the thing that keeps moving.

    Out: the ball placed correctly on 267 of 356 labelled frames and wrongly on 2, up from 176 and 52 with the first tracker.

  3. 03

    The instant it hits the floor

    A bounce is a kink in the path, except when the ball is coming towards the camera and keeps moving down the picture after it lands. For those the detector watches the ball and its own shadow converge on the court and checks how the velocity changes after they meet. The last bounce of each point comes from a fit to the incoming and outgoing paths, then gets scored against contact frames I labelled by stepping through the footage.

    Out: 19 of the 24 labelled bounces found, every one within 50 ms of the labelled frame.

  4. 04

    The court from its own lines

    The live trial calibrates a camera with five taps on painted corners, and nobody is going to do that at open play. So the replay now finds the court itself. Pale straight streaks in the contact frame are gathered into lines by a Hough vote, pairs of lines are tried as sidelines and baselines, and the perspective fit that lands the whole eight-segment line plan on paint, with real lines found along at least six of the segments, is kept and refined. With a court the mark goes on the plan, the gap is measured to the court's own line in millimetres and the call needs no tap. Without one the painted line is the ruler and the app asks which side the court is.

    Out: the court found on 7 of 19 bounces, all 7 calls right and no court found wrongly. Across the 24 labelled calls, 12 right automatically, 7 with no tap at all, 1 wrong.

  5. 05

    A second opinion from Claude, and when to overrule it

    With the host's opt-in the app sends Claude up to five stills per camera around the bounce or the paddle contact, with a close-up where the ball was tracked. The key stays on the server, ten reviews an hour per host, sixty a day. The first wide-frame reviews invented a strike at a floor bounce. The close-up fixed most of that, and on the next five plays four answers matched the footage. The one that did not was a wide ball where Claude described a hit from the receiver's posture while the pixels showed the ball bouncing on open ground 21 ms earlier. So the app now checks the gap between paddle and ball itself and returns no contact visible, keeping Claude's answer beside it for inspection.

    Out: a paid opinion the app can disagree with, and the evidence for both saved with the point.

§ 03

What it runs

One web app on both phones, one small service behind it.

On the court

  • Pairing. A one-use QR invitation that expires in ten minutes. The game belongs to the two phones that paired, and a third can only watch.
  • Record and replay. Both angles saved in the host's browser, replayed together with slow motion and a strip of frames around the bounce.
  • Ball mark. The trail, the contact, the gap to the line with its give-or-take, the mark on a plan of the court and the call.
  • Kitchen review. A paddle detector and a pose model bookmark likely strikes and the visible shoes, and you can correct them or add one the scanner missed.
  • Export. A ZIP with both videos and every machine estimate and human label, kept apart so corrections stay traceable.

Behind it

  • The silent trial. Arm a rally and one clear camera can propose an out from calibrated floor geometry. The proposal stays hidden until the player has labelled the point, so the app cannot lead the witness.
  • Claude review. Stills and close-ups go to Claude through the server, which holds the key, counts the requests and keeps recent answers for an hour so a repeat costs nothing.
  • The measurements. Every result on this page is a JSON file in the repository, with the frame numbers, the labels and the source of the footage, and the handover says how to rerun each one.
Both camera angles of one point on the phone, near sideline above far sideline, with the tracked ball ringed on the court.
Both angles of one point, with the tracked ball ringed. Footage: Pickleball Wanderers, Seattle.
§ 04

What is still open

Three days is enough to measure, not enough to finish.

Where the numbers fall short

  • A washed-out white ball beats the tracker. On the sunny fisheye footage the finder misses the bounces, and a probe I added shows the ball is dark at the contact frame and grey in three of the five clips. That is a retrain of the network, not a threshold. Two colour-gate ideas were measured and dropped because each broke a clip that worked.
  • The court finder declines four recordings out of six. Lines one or two pixels wide, a court at dusk, portrait video with a hundred-pixel near sideline, and a fisheye lens that bends straight lines. Those are the next steps, with a radial term in the refit and the fit cached per camera per game.
  • One wrong call stands. A wide ball on a junior court where the only paint near the mark belongs to the next court over.
  • The kitchen scanner found five of eight labelled strikes. It can put a shoe next to the line. Whether that shoe bore weight on it still needs a person.

Waiting on a real court

  • No full match on two physical phones yet. The pairing, replay and export paths are driven by fake cameras in two browser processes, and every call was measured on public footage. A tripod on a windy day is a different test.
  • The audible call is off. The trial stays silent and the players make the final call. A beep that is wrong one time in twelve is worse than no beep.
  • A phone at thirty frames a second will not reach a broadcast system's millimetres. Which is why every distance on the screen carries its give-or-take, and the ones this page quotes carry theirs.
§ 05

Nothing to install

Why this matters if a camera has to measure something for you.

Vite, React and TypeScript in the browser, WebRTC for the camera, IndexedDB for the recordings, and the ball model in a worker. One Node service on Railway. Nothing to install on either phone.

Frames are decoded in the browser with mediabunny, the ball network runs under onnxruntime-web, the kitchen review uses a MediaPipe pose model and an EfficientDet paddle detector, and the review calls Claude Opus 5.5 through the server. Playwright suites drive fake cameras through pairing, replay and export, and the footage harnesses run in Chrome with ffmpeg cutting the frames.

AI agents wrote most of the code. I directed, labelled the footage and measured, and a change that touched a call only stayed if the rerun against the labels said so. The 74 commits are the record of what stayed.

If you have a problem where a phone camera has to measure something, or a prototype that works on the demo clip and nowhere else, that is the conversation to have. corey@comcomputing.im.