Skip to main content

Crate wordfeud_ocr

Crate wordfeud_ocr 

Source
Expand description

An OCR library that reads the state of a Wordfeud board from a screenshot

This library recognizes the tiles on a Wordfeud board and rack, and also the bonus squares on the board.

§Basic usage

let path = "screenshots/screenshot_english.png";
let gray = image::open(path)?.into_luma8();
let board = Board::new();
let result = board.recognize_screenshot(&gray)?;
println!("Tiles:\n{}", result.tiles_ocr);

Structs§

Board
Wordfeud board recognizer
Layout
Represents the layout of a wordfeud board
Ocr
Recognized letters or bonus squares, organized as a two-dimensional grid.
OcrResults
Holds the result of recognize_screenshot: recognized tiles on the board and rack, plus grid with bonus squares.
OcrStat
Results for a single template match

Enums§

Error
Errors that can occur when recognizing the board

Functions§

collage
Create a collage from parts of a source image. TODO: All parts must be the same size
save_templates
Save tiles as templates

Type Aliases§

OcrStats
A list of OcrStat. Can be used to analyze the accuracy of template matching.