pythoncomputer-visionbarcode-scannerpdf417

Detect (and maybe decode) PDF417 barcodes using python


I am trying to detect the pdf417 barcode (2D barcode) from an image using python.

I will be receiving images of IDs where there is a barcode in them but it might not always be straight. So I am looking for an effective way to DETECT the pdf417 barcode using Python.

I tried all of the available methods that I could find (that uses python) e.g.,

Is there a method that I missed? Am I using a wrong approach towards this problem?

Thanks!


Solution

  • After various trials, I ended up using an approach of template matching by OpenCV. You need to precisely choose your template image that will be the search reference of your algorithm. You need to feed it some grayscaled images. Then, you need to choose the boxes that have a result higher than a certain threshold (for me 0.55). Then apply NMS (non max suppression) to filter out the noisy boxes.

    But keep in mind that there are many edge cases to encounter. If someone is interested to see the complete solution, please let me know.

    enter image description here