New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add optional ASSUME_COMPACT_PDF_417 decode hint (fixes #1624) #1627
Conversation
I'm ok with it. Is there any reasonable way to do this automatically without a flag or does the caller really have to hint what it's looking for? |
The root issue is that there are magic fudge factors intended to make the system lenient to imperfect images, and these leniency factors end up considering a legitimately non-matching module sequence as a "good enough" match for the standard PDF417 stop pattern. This messes up the whole symbol detection algorithm. These leniency factors are The problem is that I have no idea how these magic factors were derived. The change needed for |
Oh, just crudely hand tuned to give the best perf on a small training dataset probably 15 years ago. Not that magic, but yeah changing it significantly could shift results. Not worth rocking the boat much. I think this is pretty fine, if the use case is a bit of a special case. |
I just realized that some other symbologies have similar ITF: 0.5 Maybe changing it to 0.7 would be OK? |
Try it; if it doesn't make tests worse net-net, then it'd be OK too. You can see the # of images that pass and fail and it'll highlight where it's better or worse. |
Every PDF417 image in the current test set decodes correctly at I have to reduce I'm fine either way (flag or adjust factor to |
If you have a sec, open a PR with just the threshold change. That's simpler and if it's effective, might be a nicer place to start |
OK, I'll create a separate PR and you can reject this one -- that way we can reference this PR later if needed (if the threshold change doesn't work out for whatever reason). |
This is a proposed fix for bug #1624. Tests 01 and 02 test basic decoding capability with the new flag enabled, and test 03 is confirmed to fail without the flag.