BarcodeDetection
- class BarcodeDetectionPrediction(box, barcode_type, info)
A single prediction from
BarcodeDetection
.- Parameters:
- class BarcodeDetectionResults(predictions, image)
All the results of barcode detection from
BarcodeDetection
.- Parameters:
predictions (
List
[BarcodeDetectionPrediction
]) – The boxes, type and info for each prediction(detection).image (
ndarray
) – The image that the detection was performed on.
- property predictions: List[BarcodeDetectionPrediction]
The list of predictions.
- markup_image()
Draw detected barcode boxes on the image.
- Return type:
- Returns:
The marked-up image
- class BarcodeDetection
Locate, detect and decode the barcode(s) within an image.
Typical usage:
barcode_detector = edgeiq.BarcodeDetection() <get image> results = barcode_detector.localize_decode(image) image = results.markup_image() for prediction in results.predictions: text.append("{}: {}".format( prediction.barcode_type, prediction.info))
- localize_decode(image)
Localizes and decodes barcodes in an image.
- Parameters:
image (
ndarray
) – The image to analyze.- Return type:
- localize(image)
Localize barcode(s) within an image.
- decode(image, boxes)
Decodes localized barcode(s).
- Parameters:
image (
ndarray
) – The image on whichBarcodeDetection.localize()
was used to obtain the boxes.boxes (
ndarray
) – The localized barcode boxes returned byBarcodeDetection.localize()
.
- Return type:
- publish_analytics(results, tag=None, **kwargs)
Publish Barcode Detection results to the alwaysAI Analytics Service
Example usage:
try: barcode_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:
results (
BarcodeDetectionResults
) – The results to publish.tag (
Optional
[Any
]) – Additional information to assist in querying and visualizations.
- 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.