6

I've looked everywhere and I've only found information related to generating PDF417 codes, but nothing regarding how to decode them. Is there a library to decode them in python? I'm already detecting the code in an image and croping it, but now I need a decoder.

4

2 回答 2

4

I found this little piece of code, which does just what I want. It decodes PDF417 barcodes. Doesn't seem to be that robust though, so I'll guess I'll have to give the images some strong processing to extract only the barcode.

于 2017-11-08T17:00:01.343 回答
2

There are two libraries that I know of for decoding PDF417 barcodes.

You can checkout python-zxing which is a python wrapper for the ZXing decoder or you can use pdf417decoder which is a native Python port of a C# PDF417 decoder library.

ZXing requires files to be saved to the disk first while pdf417decoder can take a PIL Image object directly.

于 2021-04-05T20:33:13.477 回答