Journal

Parsing dominoes with computer vision

·
GitHub
computer vision
Texas42

A recent GitHub experiment: using a phone camera to read a dominoes board and suggest the next legal moves.

I spent a few evenings last month trying to teach my phone to read a Texas 42 dominoes board. The goal was simple: point the camera at the table, get back a digital copy of the layout and a list of legal plays.

It turns out dominoes are a lovely computer-vision problem. The tiles are small, the pips are low-contrast, and the lighting at most tables is terrible. My first approach used classic blob detection and failed hilariously on shadows.

The second approach leaned on a small vision model for object detection, then refined the coordinates with a few hand-written heuristics. It is still far from production-ready, but it now works in about seven out of ten real-world photos, which felt like a magic threshold.

The project lives on GitHub, and I plan to fold the working pieces back into Texas42. The real lesson, though, is how much faster you learn when the failure mode is immediately visible on your own dining table.