← Back

Tool · Computer vision · In-browser

Billiard Ball Mapper

Photograph a pool table — live or from your library — and get a clean top-down map of where every ball actually is. Everything runs in your browser: the photo never leaves your device.

1

Photo

A photo taken from directly above the table works best, but an angled shot is fine too — the next step corrects the perspective.

How it works

Runs entirely client-side with OpenCV.js (a WebAssembly build of OpenCV) — no photo is ever uploaded anywhere. The four corners you mark define a perspective transform that warps the table to a flat top-down rectangle; a Hough circle search on that warped image finds each ball, and its color is classified by sampling the pixels near its center against a reference pool-ball palette. It's a good first pass, not a certainty — the manual editing in step 3 exists specifically because lighting, glare, and odd angles can fool it.