Skip to content
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

[BUG] Not able to scan the barcode of this image using this library, however able to scan it with the phone app #20

Closed
kotasudhakar opened this issue May 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@kotasudhakar
Copy link

Describe the bug

Not able to detect barcodes in certain cases like in the image attached, while it is completely working barcode and tried to scan the same with some online barcode readers and with my phone both worked fine.

To Reproduce

  1. Open demo website -> https://undecaf.github.io/zbar-wasm/example/
  2. and scan this below image with the barcode
    2024-04-15_14-37

A minimal working example that reproduces the behavior would be much appreciated.

Or else the environment in which the behavior occurs needs to be specified:

  • Which target environment (Node/browser/other)?
  • Browser
  • Which type of modules (ESM/CommonJS/other)?
  • Which framework(s)?
  • Which devtools, including their configuration files?
  • package.json content
  • Any other context about the problem

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

@kotasudhakar kotasudhakar added the bug Something isn't working label May 13, 2024
@undecaf
Copy link
Owner

undecaf commented May 13, 2024

IMHO the quality of that image is just too low for being scanned by zbar.

Could you please tell me which online barcode readers you were using and which barcode type they reported? Thank you.

@undecaf
Copy link
Owner

undecaf commented May 15, 2024

Thank you @kotasudhakar for the list.

https://online-barcode-reader.inliteresearch.com/ reports a module size of 1.8px which makes this quite an edge case.

https://nanonets.com/barcode-scanner did not scan the barcode at all, it just detected the characters above and below the barcode.

Since zbar-wasm uses the Zbar barcode reader (compiled to WASM) in the background, there is nothing I can do in order to improve detection quality. I can only suggest that you open an issue at that project that suggests to improve detection for barcodes with very small module sizes.

@zcattacz
Copy link

zcattacz commented May 16, 2024

Hi @undecaf, maybe have a try on this one https://zxing-wasm-demo.deno.dev/, when binarizer is switched to FixedThrethold mode, it works. Clicking on the green circle on the upper right corner displays the decoded detail.

@undecaf
Copy link
Owner

undecaf commented May 23, 2024

Thank you @kotasudhakar, @zcattacz for your contributions to this issue.

IMHO, it is not a bug if a scanner is not able to recognize a barcode because of low image quality -- it is just a consequence of the amount of detection effort in the scanning algorithm.

zbar-wasm is intended to be fast enough to scan barcodes in mobile browsers from the video stream of the camera. If real-time scanning is not required, detection quality could be improved by preprocessing images in JS before passing them to the scanner, but this is outside the scope of zbar-wasm.

Therefore I hope you understand that I am closing this issue.

@undecaf undecaf closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants