QRCodeDetector implementation
The Watcher base class
# The images will be processed using OpenCV and Numpy
import cv2
import numpy
# The decode_qrcode function will be used for decoding the found QR Code
from pyzbar.pyzbar import decode as decode_qrcode
# Used for sending the logs to the ':8888/logs' endpoint
import logging
# For identifying the source of the logs
logger = logging.getLogger("lampix.QRCodeDetector")
from lampix_imports.watcher import Watcher
# Will be used to specify the used trigger for this Watcher
from lampix_imports.watcher import TriggerType
class QRCodeDetector(Watcher):
# Calling the base class constructor
# The id will be received from JS
def __init__(self, id, contour):
# self.contour is the property which holds the Watcher's contour
Watcher.__init__(self, id, contour)Vision trigger
Triggering the Watcher
Parameters
QR Code detection
Report data to JavaScript
Extra:
The motion trigger
Example:
Multithreaded processing
Last updated
Was this helpful?