Photo to FEN

Convert a real board photo into a standard FEN by fixing the board corners and matching pieces with templates.

The goal of the first version is not to solve every difficult photo. It is to turn a chessboard photo into an analyzable position quickly. This MVP uses manual corner correction and template matching so you can get to FEN, then continue into review and analysis.

Author: Sachess Editorial Team · Updated: 2026-06-22 · 3 Sources

Highlights

  • Upload an image and drag the four corners to frame the board.
  • The board is rectified, then the 90 intersections are checked.
  • The result can be turned into FEN and corrected in the editor.
  • Good for phone photos, chat screenshots, and over-the-board games.

Steps

01

Upload a clear board photo and try to keep the whole board in frame.

02

Drag the four corner points to line up the real board border, then choose the side to move.

03

Run recognition so the app can match templates at each intersection and generate a starter FEN.

04

If a few pieces are wrong, open the board editor, fix them, and continue to analysis.

Details

Why the first version should be semi-automatic

Real photos vary a lot in lighting, angle, piece style, and background. A fully automatic version would take much longer to build and would be harder to trust. A semi-automatic flow lets us nail the geometry first and then ask the user to confirm the last small step. That gets value into your hands sooner and creates real data for future improvements.

The first version is not trying to be perfect. It is trying to make a photo analyzable as FEN so you can test whether users actually want the feature. Once usage starts to grow, you can keep improving recognition with real samples instead of guesswork.

  • Stabilize geometry first, then chase better recognition.
  • User correction reduces early frustration.
  • Real user data is more valuable than synthetic samples.

What template matching is good at

Template matching is simple, controllable, and cheap, which makes it ideal for the first recognition pass. It works best when the piece style is fairly consistent, such as a tournament board, a teaching board, or the piece set you design around. It is not as powerful as a trained model, but it is fast enough for an MVP.

Later, if certain photo types keep failing, you can collect those examples as training data and swap in a local model. For now, getting the workflow running matters more than maximizing accuracy on day one.

  • Good for fast validation.
  • Best with clean, consistent piece styles.
  • Can later be upgraded to model-based recognition.

FAQ

Do I need a cloud AI API
No. The first version keeps geometry correction and template matching in the browser, which keeps costs low.
What if recognition is wrong
Open the board editor, correct the position manually, and continue with the corrected FEN.
Can it read any photo
The first version works best on clear board photos with the board mostly in frame and a reasonable viewing angle.
What happens after recognition
First confirm whose turn it is, then open the analysis page to inspect engine and cloud-book suggestions.

Sources

OpenCV.js intro OpenCV geometry transforms OpenCV template matching

Related Pages