Browse docsvision.ocr
On this page
API method

vision.ocr

Configures OCR and returns an ocr value.

Syntax

Atlas Script
vision.ocr(roi?, language?, enabled?)

Parameters

roi Optional
Optional region of interest: a four-value [x, y, width, height] array. Pass null when the method accepts a full-frame scan.
language Optional
Optional OCR language hint. Pass null when no additional language hint is required.
enabled Optional
Optional boolean that turns this configured tool on or off. Use true to process it and false to keep its configuration without running it.

Return value

Returns ocr.

Remarks

Configures OCR and returns an ocr value. All arguments are optional: roi defaults to null for the full frame, language defaults to null (no additional language hint), and enabled defaults to true. Read/set enabled, overlay, roi; read lang, results, count, target.

Examples

Read text with OCR.atlas
const scoreRoi = [0.75, 0.02, 0.23, 0.12];
ocr scoreText = vision.ocr(scoreRoi, "eng", true);

event on_frame() {
    target textResult = scoreText.target;
    if (textResult != null) {
        ui.status(string.format("Text: {}", textResult.text));
    } else {
        ui.status("No text detected");
    }
}
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.