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

[iOS] Scanner is very bad at detecting horizontal barcodes on arched objects like bottles #68

Open
AKortak opened this issue Feb 15, 2022 · 3 comments

Comments

@AKortak
Copy link

AKortak commented Feb 15, 2022

I noticed, that the scanner is not able to detect horizontal barcodes on arched objects with an iPhone. On Android it works perfectly fine but on iOS it sometimes is impossible to detect a barcode. I use the scanner in my production code and I would be very happy if this is fixxed fast.

This image shows an example of an object where it is very hard to scan the barcode:

IMG_20220215_133130 2195

@jhoogstraat
Copy link
Owner

jhoogstraat commented Feb 16, 2022

The heavy lifting of actually extracting the barcode information from the image is not done by this plugin.
This plugin uses AVFoundation by Apple for this task.

The (newer) Vision Framework can also scan barcodes and is already implemented into the plugin. Maybe it works better in edge cases because its based on machine learning, instead of manually coded algorithms.
As soon as #66 is merged, you will be able to switch between the two implementations.

@dustin-graham
Copy link
Collaborator

@AKortak , I encountered the same issues while working on this plugin. Here's the summary of what I learned:

The current implementation of barcode scanning @jhoogstraat mentioned is AVFoundation. AVFoundation has a documented limitation for lnear barcodes where it will only recognize them if the barcode is exactly in the center of the screen. This took me a comically long time to discover and I was able to find old documentation from Apple which confirms it.

As @jhoogstraat pointed out, my PR #66 provides you the option to switch to the new Vision API for scanning. The Vision API does a fantastic job with linear barcodes regardless of where they appear on the screen. Hopefully we'll get this merged soon and you can enjoy the new implementation.

Cheers.

@rsi2m
Copy link

rsi2m commented Apr 3, 2022

@dustin-graham great job on that PR #66 ! Looking forward to test it out once it's merged!

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

No branches or pull requests

4 participants