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

Android: Android sample app doesn't ignore shaded areas in the overlay when scanning for QR/Bar code #87

Closed
asednev opened this issue Jan 23, 2014 · 9 comments
Milestone

Comments

@asednev
Copy link

asednev commented Jan 23, 2014

Original Barcode Scanner app based on ZXing java library does an outstanding job ignoring any possible QR codes in the shaded areas in overlay. ZXing.Net.Mobile implementation, however, disregards what's shaded in overlay and still looks for QR codes in the full frame.

Please see the screenshot below, I expect "A2 PART" being scanned nonetheless "TEST" gets scanned every single time when I point a camera the way it's on the screenshot.

Is this by design? Is there a way to achieve the behavior I expect?

Thanks

screenshot_2014-01-23-07-23-51

@Redth
Copy link
Owner

Redth commented Jan 28, 2014

You're right, it does not exclude the grey areas (they are really just for show).

Currently there's no way to ignore certain regions of the preview from being checked... I suspect there is a possibility that multiple barcodes could be detected, but right now there's no way to request that to be checked, so it probably just returns the first one it sees...

Unfortunately there's not a great short fix that I can think of for this scenario. Yes I could only check a certain region, but what would the region be set to? It makes sense to use the non-gray areas if you're using the default overlay, but if you use a custom overlay, you might not want the same region checked. On Android there's so many different possible screen sizes, and even possible preview resolutions that it's not really as simple as specifying a region to crop. The only eventual possibility I think that might make sense is to be able to specify some sort of included region based on a % of the screen dimensions (eg: SetPreviewRegion(leftPaddingPercent, rightPaddingPercent, topPaddingPercent, bottomPaddingPercent); )... I'll mull that idea over...

For now, you'll just have to be careful in how you show the scanner a barcode... Sorry :(

@gerryhigh
Copy link

I would definitely like something like this. When I'm scanning 1D barcodes I'd ideally like to restrict it to scan a rectangular (landscape view); whereas when scanning 2D I'd like to restrict it to a square.

@Redth Redth changed the title Android sample app doesn't ignore shaded areas in the overlay when scanning for QR/Bar code Android: Android sample app doesn't ignore shaded areas in the overlay when scanning for QR/Bar code Jul 29, 2015
@ljj901224
Copy link

has this problem been solved,I encounted the same scene.

@bmacadam
Copy link

I also think this would be a useful feature. In my case there are two barcodes in close proximity on a sticker and sometimes users think that the scanner is not working properly when in fact the issue is that the scanner is picking up the wrong barcode and it doesn't pass the validation test. I would expect that it might also improve performance if you are only checking 50% of the original preview image.

I also have to scan data matrix barcodes and it would be great if I could have a small square view finder.

@Redth
Copy link
Owner

Redth commented Mar 29, 2016

I don't disagree that it would be a useful feature :) Just need some time to implement it (on ALL platforms - which is what takes so much effort).

@Redth Redth added this to the 3.0.0 milestone Jul 18, 2016
@Tebra
Copy link

Tebra commented Jan 23, 2018

Any new information regarding this feature?

We are facing a problem which this feautre would solve immediately.

@christophedemey
Copy link

Hi, any news on how to not have this behaviour ? Is there any workaround ?

Thanks.

@aashish181188
Copy link

aashish181188 commented Sep 24, 2019

@Redth , Is this issue fixed. Currently we are implementing barcode scan using ZXing in our Xamarin Forms project and we are facing issue with scanner. The scanner scans the barcode which not even in focus i.e. red line. It is a blocker for us, Kindly assist on this.

Any hint/tips appreciated.

package - https://www.nuget.org/packages/ZXing.Net.Mobile.Forms/
Technology - Xamarin Forms
platform - iOS

If you need any other information , please let me know.

Thanks,
Aashish

@Redth
Copy link
Owner

Redth commented Mar 13, 2020

Track this in #791

@Redth Redth closed this as completed Mar 13, 2020
@Redth Redth modified the milestones: 3.0, 3.1 Mar 13, 2020
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

8 participants