android-vision icon indicating copy to clipboard operation
android-vision copied to clipboard

Wrong Value for the barcode

Open AbdulSalamAli0018 opened this issue 8 years ago • 12 comments

I have the barcode that I am scanning using this API. I get wrong value most of the time. let say 1 correct value out of 10 tries. I though I might have changed some configurations. Thought to try the sample code but to my amazement , I have noticed to bad behavior there also. img_20171004_181143

but When I tried scanning it with the scadit , it has 10/10 accuracy.

the image is as below ....

img_20171004_181143

AbdulSalamAli0018 avatar Oct 06 '17 11:10 AbdulSalamAli0018

I am having a similar issue when scanning Code 128 barcodes. It will recognize the correct value (e.g. 0067) but will simultaneously detect a similar but incorrect value (e.g. 0068)

ctorx avatar Feb 01 '19 19:02 ctorx

Could you solve this problem? I have the same problem now.

bbb-levin avatar May 17 '19 10:05 bbb-levin

I did solve it.

There is something happening internal in the vision library that is mis-reading barcodes, and I was able to reproduce the mis-reads on demand. I could not resolve the issue using settings or methods provided by the library itself.

Rather, I created a class to extend Detector<Barcode>. Every time a new frame is fed in to this class, I compare it with the last N frames (4 in my case). If the same value is not recognized for 5 consecutive frames, I assume it is a misread and ignore it.

This is not ideal because it adds some latency to scanning but also because it does not allow scanning of multiple barcodes simultaneously. Luckily for me, my use case was not impacted.

On Fri, May 17, 2019 at 3:32 AM bbb-levin [email protected] wrote:

Could you solve this problem? I have the same problem now.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-vision/issues/273?email_source=notifications&email_token=AACT5Z6XPBYQSPVNWSFFKLTPV2CT5A5CNFSM4D6BNT7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVUMWZA#issuecomment-493407076, or mute the thread https://github.com/notifications/unsubscribe-auth/AACT5ZYB2646KUBVCZZZ5Y3PV2CT5ANCNFSM4D6BNT7A .

ctorx avatar May 17 '19 14:05 ctorx

I did solve it. There is something happening internal in the vision library that is mis-reading barcodes, and I was able to reproduce the mis-reads on demand. I could not resolve the issue using settings or methods provided by the library itself. Rather, I created a class to extend Detector<Barcode>. Every time a new frame is fed in to this class, I compare it with the last N frames (4 in my case). If the same value is not recognized for 5 consecutive frames, I assume it is a misread and ignore it. This is not ideal because it adds some latency to scanning but also because it does not allow scanning of multiple barcodes simultaneously. Luckily for me, my use case was not impacted. On Fri, May 17, 2019 at 3:32 AM bbb-levin @.***> wrote: Could you solve this problem? I have the same problem now. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#273?email_source=notifications&email_token=AACT5Z6XPBYQSPVNWSFFKLTPV2CT5A5CNFSM4D6BNT7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVUMWZA#issuecomment-493407076>, or mute the thread https://github.com/notifications/unsubscribe-auth/AACT5ZYB2646KUBVCZZZ5Y3PV2CT5ANCNFSM4D6BNT7A .

interesting, I wonder, what override you in Detector<T> class?

Was you override method detect(Frame)?

bbb-levin avatar May 20 '19 00:05 bbb-levin

I believe so, I don't have the code in front of me at the moment.

On Sun, May 19, 2019 at 5:33 PM bbb-levin [email protected] wrote:

I did solve it. There is something happening internal in the vision library that is mis-reading barcodes, and I was able to reproduce the mis-reads on demand. I could not resolve the issue using settings or methods provided by the library itself. Rather, I created a class to extend Detector. Every time a new frame is fed in to this class, I compare it with the last N frames (4 in my case). If the same value is not recognized for 5 consecutive frames, I assume it is a misread and ignore it. This is not ideal because it adds some latency to scanning but also because it does not allow scanning of multiple barcodes simultaneously. Luckily for me, my use case was not impacted. … <#m_-7800142228855503596_> On Fri, May 17, 2019 at 3:32 AM bbb-levin @.***> wrote: Could you solve this problem? I have the same problem now. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#273 https://github.com/googlesamples/android-vision/issues/273?email_source=notifications&email_token=AACT5Z6XPBYQSPVNWSFFKLTPV2CT5A5CNFSM4D6BNT7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVUMWZA#issuecomment-493407076>, or mute the thread https://github.com/notifications/unsubscribe-auth/AACT5ZYB2646KUBVCZZZ5Y3PV2CT5ANCNFSM4D6BNT7A .

interesting, I wonder, what override you in Detector class?

Was you override method detect(Frame)?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-vision/issues/273?email_source=notifications&email_token=AACT5Z36T3ZOKYOEN3T2PHDPWHWVJA5CNFSM4D6BNT7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVXOEXY#issuecomment-493806175, or mute the thread https://github.com/notifications/unsubscribe-auth/AACT5ZYF6W7I7ZQYSIMB2S3PWHWVJANCNFSM4D6BNT7A .

ctorx avatar May 20 '19 16:05 ctorx

@ctorx how did you reproduce the mis-reads? Do you know whether this affects all Barcodes (specifically QR codes) or just Code 128 barcodes?

howardwkim avatar Nov 04 '19 20:11 howardwkim

It only reproduces for some barcodes, not all of them, so it is a matter of finding a particular barcode that causes mis-reads. Out of thousands, we only found a handful of them. For us it was just the Code 1278 barcodes.

ctorx avatar Nov 04 '19 21:11 ctorx

So I should find the offending QR code and scan to see whether I can reproduce the mis-read?

"something happening internal in the vision library that is mis-reading barcodes" - can I interpret this to mean that there is a potential bug causing misreads?

Also, did you get consistent mis-reads? I.e. it was the wrong code, but the same wrong code each time.

howardwkim avatar Nov 04 '19 21:11 howardwkim

Yes, I assume there is a bug in the library. IIRC the library issuing machine learning to identify bar codes, so it is possible that the ML model has not been trained on a few edge cases properly.

The mis-reads were consistent in my case .. while scanning a barcode with a value of 1000 for example, the library would routinely return either 1000 or 1010.

On Mon, Nov 4, 2019 at 1:11 PM Howard Kim [email protected] wrote:

So I should find the offending QR code and scan to see whether I can reproduce the mis-read?

"something happening internal in the vision library that is mis-reading barcodes" - can I interpret this to mean that there is a potential bug causing misreads?

Also, did you get consistent mis-reads? I.e. it was the wrong code, but the same wrong code each time.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-vision/issues/273?email_source=notifications&email_token=AACT5Z72NO3E6SAYQLZYQDDQSCFWDA5CNFSM4D6BNT7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDAXEGY#issuecomment-549548571, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACT5Z3TNZ3CQAV36SVQAGDQSCFWDANCNFSM4D6BNT7A .

ctorx avatar Nov 04 '19 22:11 ctorx

Our original QR code is Alphanumeric. The mis-reads are always numeric and always different. Hopefully I can reproduce the error. Thanks for the help!

howardwkim avatar Nov 04 '19 23:11 howardwkim

If you don't need to read more than one code simultaneously, you can use the approach I mentioned earlier in the thread.

On Mon, Nov 4, 2019 at 3:32 PM Howard Kim [email protected] wrote:

Our original QR code is Alphanumeric. The mis-reads are always numeric and always different. Hopefully I can reproduce the error. Thanks for the help!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googlesamples/android-vision/issues/273?email_source=notifications&email_token=AACT5Z6D4OETXBVC6E66ZODQSCWHVA5CNFSM4D6BNT7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDBCQXQ#issuecomment-549595230, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACT5Z3J3FK7LU5CXSL5PTTQSCWHVANCNFSM4D6BNT7A .

ctorx avatar Nov 05 '19 00:11 ctorx

@google-admin please try to look into it. wrong value of barcode many times on the different barcodes.

vishalpatel1327 avatar Jul 20 '20 11:07 vishalpatel1327