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.
2 回答
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.
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.