QRCodeDetection

class QRCodeDetectionPrediction(box, info)

A single prediction from QRCodeDetection.

Parameters:
  • box (ndarray) – The vertices of the detected QR Code.

  • info (str) – The decoded QR Code information

property box: ndarray

The bounding box around the detected QR Code.

property info: str

The extracted QR code information

class QRCodeDetectionResults(predictions, image)

All the results of QR code detection from QRCodeDetection.

Parameters:
property predictions: List[QRCodeDetectionPrediction]

The list of predictions.

property image: ndarray | None

The image the results were processed on.

markup_image()

Draw detected QR Code boxes on the image.

Return type:

Optional[ndarray]

class QRCodeDetection

Locate, detect and decode the QR Code(s) within an image.

Typical usage:

qrcode_detector = edgeiq.QRCodeDetection()

<get image>
results = qrcode_detector.localize_decode(image)
image = results.markup_image()

for prediction in results.predictions:
    text.append(prediction.info)
localize_decode(image)

Localizes and decodes QR Codes in an image.

Parameters:

image (ndarray) – The image to analyze in BGR format.

Return type:

QRCodeDetectionResults

publish_analytics(results, tag=None, **kwargs)

Publish QR Code Detection results to the alwaysAI Analytics Service

Example usage:

try:
    qrcode_detector.publish_analytics(results, tag='custom_tag')
except edgeiq.PublishError as e:
    # Retry publish
except edgeiq.ConnectionError as e:
    # Save state and exit app to reconnect
Parameters:
Raises:

ConnectionBlockedError when using connection to the alwaysAI Device Agent and resources are at capacity,

Raises:

PacketRateError when publish rate exceeds current limit,

Raises:

PacketSizeError when packet size exceeds current limit. Packet publish size and rate limits will be provided in the error message.