Skip to content

Fix camera detection, persistent board locks, and move overlays - #6

Merged
Pyrexus merged 2 commits into
mainfrom
fix/real-camera-recognition
Nov 26, 2026
Merged

Pyrexus merged 2 commits into
mainfrom
fix/real-camera-recognition

Conversation

@Pyrexus

@Pyrexus Pyrexus commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Camera scans could lose their board boundary while refocusing, repeat stale corners indefinitely, or fail before detection because the API and detector accepted different arguments. This change restores image analysis, keeps a dashed boundary for up to eight seconds while hiding unverified advice, and releases expired geometry even when the client echoes old corners.

The detector now uses grid-line candidates and lighting-aware checker measurements, with occupancy sampling that tolerates moderate defocus. The frontend selects the sharpest of three camera frames, requests continuous focus where supported, preserves explicit manual corners, and follows automatic board rotation. Side-to-move correction is independent of playing color. Canceled captures cannot send stale requests, and unverified responses cannot consume position setup or replace the active position.

Cold Railway containers also receive a 15-second allowance to initialize Stockfish and load its neural network, followed by the normal three-second operation timeout. Previously, an initialization timeout could leave the deployment permanently using the weaker fallback engine.

Validation: 105 backend tests, 6 overlay unit tests, and 16 browser tests passed, including actual browser-to-backend image analysis, phone/tablet/desktop layouts, blur/shadow/low-contrast cases, lock expiry, turn tracking, camera cancellation, and aligned legal move overlays. The 16 engine tests also pass after adding a delayed real UCI subprocess regression for cold startup (106 backend cases in total). A saved physical photo localized successfully; the heavily occluded screen photo was withheld as unreadable.

Piece identities still require a standard starting arrangement or an exact FEN setup for an existing game. Downloaded experimental classifiers were evaluated and excluded after misreading physical pieces. Severe blur or occlusion cannot be treated as a verified position.

@Pyrexus
Pyrexus merged commit 60669c0 into main Nov 26, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant