QR
QR Actions read QR codes and barcodes from image files on the robot host using OpenCV and Pyzbar.
Return values become robot state variables (for example
$qr_code,$barcode).
Index
Actions
qr.read_barcode
Extracts barcode values from an image file (non-QR symbologies via Pyzbar).
When preprocessing is enabled, contrast enhancement and morphological filters are applied to improve detection. The action may retry decoding on cropped regions when nothing is found on the full frame.
Parameters:
image_path - path to the image file.
preprocess (optional) - when True, applies the barcode preprocessing pipeline (default=True).
Return:
barcode - first decoded barcode string when one or more codes are found; empty list [] when none are detected.
Exceptions:
FileNotFoundException: when the image cannot be loaded.
InvalidImageExtension: on processing errors while reading the image.
qr.read_qrcode
Extracts text or URLs encoded in QR codes from an image file.
When preprocessing is enabled, the image is converted to grayscale and enhanced with CLAHE and median blur before decoding. The action also attempts decoding on square regions if no code is found on the full image.
Parameters:
image_path - path to the image file.
preprocess (optional) - when True, applies CLAHE and median filtering before decode (default=True).
Return:
qr_code - first decoded QR value when one or more codes are found; empty list [] when none are detected.
Exceptions:
FileNotFoundException: when the image cannot be loaded.
InvalidImageExtension: on processing errors while reading the image.