On this page
vision.barcode
Configures native barcode detection and returns a barcode value.
Syntax
Atlas Script
vision.barcode(roi?, 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.
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 barcode.
Remarks
Configures native barcode detection and returns a barcode value. Read/set enabled, overlay, roi; read results, count, target.
Examples
Read QR and barcode text.atlas
qr qrCodes = vision.qr(null, true);
barcode barcodes = vision.barcode(null, true);
event on_frame() {
target qrResult = qrCodes.target;
target barcodeResult = barcodes.target;
if (qrResult != null) {
ui.status(string.format("QR: {}", qrResult.text));
} else if (barcodeResult != null) {
ui.status(string.format("Barcode: {}", barcodeResult.text));
} else {
ui.status("No code detected");
}
}