Crops and splits the screenshot, auto-detects the piece set, reads the symbols, and resolves orientation into a FEN.
Usage
recognize_position(
image,
libs = load_all_template_libraries(),
ctx,
turn = "w",
autocrop = TRUE,
orientation = "auto"
)Arguments
- image
A magick image of the raw screenshot.
- libs
Named list of template libraries to auto-detect across (default: every locally available set, via
load_all_template_libraries()).- ctx
A chess.js V8 context from
new_chess_context().- turn
Side to move, "w" or "b".
- autocrop
Whether to trim near-uniform margins before splitting.
- orientation
One of "auto", "white" (white on bottom) or "black".