On this page
vision.ocr
Configures OCR and returns an ocr value.
Syntax
Atlas Script
vision.ocr(roi?, language?, enabled?)Parameters
roiOptional- Optional region of interest: a four-value [x, y, width, height] array. Pass null when the method accepts a full-frame scan.
languageOptional- Optional OCR language hint. Pass null when no additional language hint is required.
enabledOptional- 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");
}
}