Skip to content

Code 128 Barcode Accuracy #104

@dsanders11

Description

@dsanders11

I've been testing out this project for using to read barcodes on USPS shipping labels, but I've noticed that the results are sometimes very, very wrong and sometimes are only slightly wrong. Since the result is a 30 character string, it's hard to spot the subtle incorrect ones without going through the entire string, which defeats the purpose of scanning the barcodes.

I dug into the code and found that it is correctly using the checksum (yay) on the Code 128 barcodes, but is still coming up with the wrong result because there are multiple ways to get to the same checksum value.

I've gotten more accurate results by adding a few checks to Code128Reader: I added a final check that no individual code has an error above X, and a check that the checksum code has an error below Y. The rationale behind that is if the checksum is not trustworthy (high error) then it will end up OKing an incorrect value for the barcode.

With those tighter checks the incidence rate for incorrect values goes down. The tradeoff is it takes longer to scan the barcode because the correct spot must be found to get it to read. However, it is basically rejecting incorrect values until it ends up with the correct one, which is what I want. Using a higher resolution (and closer focus) webcam yields better results.

Is it possible to make these configurable into quaggaJS so that they can be tweaked via the config and not need a custom version? I see some hint of configs being supported for readers but no way to provide one when configuring quaggaJS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions