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

Scanning Area (Crop) / Perfomance #588

Open
gyto23 opened this issue Feb 9, 2024 · 2 comments
Open

Scanning Area (Crop) / Perfomance #588

gyto23 opened this issue Feb 9, 2024 · 2 comments

Comments

@gyto23
Copy link

gyto23 commented Feb 9, 2024

First of all, I want to say, great library!

I have implemented a simple barcode scanner on my app and I was planning to enhance it with specific items in it. I want to scan a specific barcode on the screen using video stream, however, its got into a problem when I have more than 3-4 barcodes on the same screen, and sometimes library picks the wrong one or doesnt even read it. I know it was already asked before in #39. However, for me it doesnt make no sense how to make a crop window that will scan only specific area.

I have recreated an example that was give but it only picks 1 code out of 20 when I am scanning it. https://stackblitz-starters-16tvvs.stackblitz.io

On the other hand, strich compare even other libraries and it looks common that it not always scanning properly.

Is there a way to have library always scan a barcode (20 out of 20 with faster performance) and what is best solution to have small area to scan (without overcomplicated scenario)? Also, have any one tried before to make a some sort of window that sticks to barcodes as canvas rectangle so at least we can see where camera is pointing when scanning.

Thanks

@gyto23 gyto23 added the question label Feb 9, 2024
@xulihang
Copy link

I simply use canvas to crop the image before sending it to ZXing.js: https://github.com/xulihang/barcode-detector-polyfill/blob/main/example/src/scripts/index.js#L240

Copy link

Stale issue message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants