Home Barcode & QR Reading
Post
Cancel

Barcode & QR Reading

How to read Barcode & QR?

It can be done simply by pyzbar.pyzbar.decode(input image) -> [tuple].
The return tuple includes:

  • data : The data contained in a barcode or QR code. We can get the data by decode(image).data.decode()

  • type : Represent whether it is a barcode or QR code. We can get the type by decode(image).type

  • rect : Represent the bounding box of the detected barcode & QR code.

  • polygon : Represent the detected area of barcode & QR code.

  • quality : The quality of the detected barcode & QR code.

  • orientation : There are five values of orientation which are :

    • UNKNOWN : When pyzbar are unable to determine orientation.

    • UP : Upright, read left to right.

    • RIGHT : Sideways, read top to bottm.

    • DOWN : Upside-down, read right to left.

    • LEFT : Sideways, read bottom to top.





Implementation

Barcode Generation and Reading

This post is licensed under CC BY 4.0 by the author.