News · New this week

Cricket ball speed gun: built with Claude in 54 minutes

Day 2 of vibe coding: find the ball, measure the distance, divide by time. The first test read 17 for a 140 ball.

Every gully bowler swears he bowls 140. For Day 2 of the vibe coding series, I built an app to check. A spinner picked the project, I had one hour, and no rerolls. It landed on a cricket speed gun.

The idea

Real speed guns use radar. I have a phone. So the plan is plain physics. Find the ball in every frame of a video, measure how far it flies, and divide by the time.

I gave that plan to Claude, the AI that writes my code. While it built the app, I solved a cube. The whole thing took 54 minutes.

Distance and time without any hardware

Two inputs make this work with only a video file.

The distance is known, because the stumps are a fixed distance apart. That gives the app a ruler already sitting in the shot.

The time comes from counting frames. If you know how many frames the ball spent in flight and how many frames the camera shoots each second, you have elapsed time. Distance over time gives speed.

That second part is where it went wrong.

The test that read 17

To test it, Claude made a fake delivery at exactly 140. The app said 17.

That's a useful kind of failure, because a synthetic ball has a known right answer. The cause was the frame rate. Slow-mo shoots 240 frames a second, and the app assumed 30. That's eight times too slow, and the speed came out wrong by the same factor.

One fix to the frame rate, and the same ball read 139.2. Off by less than one.

The lesson is small and general. Any speed you derive from frame counts is only as good as the frame rate you divide by. Read it from the video, don't assume it.

What the real match said

On a real club match, the app said about 85. I'm treating that one as an estimate, because there's no radar to check it against. The 139.2 is the verified number, since we knew the fake delivery's true speed. The 85 is only what the app thinks.

So the honest summary is that the method works on a controlled test, and the real-world number is plausible but unconfirmed.

If you build something like this, start with a synthetic test where you know the answer, and check the frame rate before anything else. Then go ask your gully's fastest bowler what he claims.

  • #cricketspeedgun
  • #bowlingspeed
  • #vibecoding
  • #gullycricket

More reels

All news →