BallSpeed is not a radar gun; it makes no absolute-accuracy claim. Because everyone is measured with the same algorithm, the goal is consistency and relative comparison: the same shot measured on different phones gives a close result, and you can track your own progress fairly.
How we measure
The algorithm tracks the ball in each frame, derives the pixel-to-metre scale from the reference you mark, and computes speed over the fastest 5-frame window with a linear regression of x(t), y(t). The same code runs in the browser and on the server fallback.
Frame rate (fps) and error
A higher fps reduces motion blur and places each frame more precisely:
| fps | Expected stability |
|---|---|
| 30 | Poor — noticeable blur |
| 60 | Fair |
| 120 | Good |
| 240 | Best (recommended) |
Synthetic tests
We validate the algorithm with synthetic videos of circles moving at a known speed; results stay within ±3%. The same test suite runs in Node and in a real browser, and the two environments differ by at most 1%.
Consistency criteria
We film the same shot on different phones (iPhone, Samsung, Pixel) simultaneously and compare. Our acceptance criteria:
- Cross-phone difference: median ≤ 3%, 95th percentile ≤ 6%.
- Re-analysis of the same video: no deviation (deterministic).
Known limitations
A single camera assumes planar motion; shots travelling toward/away from the camera, blur at 30 fps and an incorrect scale all affect the result. That’s why we show a confidence score and only admit measurements with confidence ≥ 60 to the leaderboards.