r/computervision • u/No_History_1015 • Oct 11 '26
Showcase Camera Chess: from single-frame recognition to live tracking with trained postprocessors
Hey everyone! I've been working on Camera Chess: playing Stockfish with a real chessboard and a camera, entirely locally on my Mac. The video above shows my favourite little feature: promoting a pawn, leaving it on the board, and continuing to use it as a queen. š The promotion is manually confirmed in the demo.
I thought the recognition side might be interesting to people here. I'm using JoĆ«l Seytre's ChessQ Lite V4, which gives piece probabilities for all 64 squares. The model is useful on individual frames, but getting a live game to stay in sync turned out to be a different problem. One bad reading can become the āprevious positionā for the next move, and then the mistakes start feeding into each other.
So I kept the vision model frozen and worked on the steps around it:
⢠Board orientation and automatic perspective correction, with a fallback to the original frame.
⢠A CRF that scores candidate boards using the visual probabilities, previous position and chess rules.
⢠Checks across consecutive frames before accepting a move, plus a correction UI when things go wrong.
For training, I replayed chess games and generated noisy piece-probability inputs: confused pieces, missing pieces, swapped squares and uncertain regions. That gave me 20,000 transition seeds and 200,000 synthetic observations. The synthetic data is at the probability level, rather than rendered chessboard images.
I then tried replacing the CRF with small MLP, CNN and attention-based scorers. Those worked reasonably well too; I'm currently using a small two-hidden-layer MLP. In my own games, the whole system now feels much smoother and more reliable, which I'm pretty excited about.
For a separate offline check, the MLP got 128/176 exact boards (72.73%) versus 125/176 (71.02%) for the CRF. These are real photos, but with previous positions constructed from the correct labels, so the correct answer is guaranteed to be among the candidates. It's a limited candidate-scoring test, not a video benchmark, and that small difference doesn't establish that the MLP is better. Full setup and results:
One detail about the video: keeping a pawn after promotion means separating what the camera sees from what the piece means in the game. That substitute-piece path uses visual likelihood, rather than the learned scorers trained without substitutes.
Code, demo and setup:
https://github.com/AmethystineAlpaca/camera_chess
Synthetic-data details:
https://github.com/AmethystineAlpaca/camera_chess/blob/main/docs/crf-data.md
It's currently a source install for Apple Silicon Macs. You move both sides' pieces yourself, and the app speaks Stockfish's reply (the video export is silent).
Curious how others handle this: when your tracker uses its last accepted prediction as the next reference, how do you test recovery after that reference goes wrong?
2
u/Kaoral Oct 22 '26
very nice! have thought about building something similar myself