Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python3
- # Dependencies
- # sudo apt install python3-zxing-cpp python3-opencv
- import zxingcpp
- import cv2
- def decode_pdf417(image_path):
- img = cv2.imread(image_path)
- barcodes = zxingcpp.read_barcodes(img)
- for barcode in barcodes:
- if barcode.format == zxingcpp.BarcodeFormat.PDF417:
- print("Found PDF417 barcode:")
- print("Text:", barcode.text)
- print("Position:", barcode.position)
- if __name__ == "__main__":
- decode_pdf417("/tmp/odf417.jpeg")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement