googlesamples / android-vision

Deprecated: The Mobile Vision API is now a part of ML Kit: Check out this repo:
https://github.com/firebase/quickstart-android/tree/master/mlkit
Apache License 2.0
2.92k stars 1.73k forks source link

No barcode detected #8

Closed Crustus closed 9 years ago

Crustus commented 9 years ago

Hi,

I'm developing app using barcode reader and currently I'm using ZBar. I copied this sample project. Face detection works perfectly. But when I try scan EAN-13 (or other barcodes) it shows nothin. Even no method call to updateItem() in Factory.

Here are two images first from this sample barcode

sencond from my app using ZBar and it detects barcode barcode_zbar

I can provide more info or do more tests if needed. ZBar is not working all the time perfectly so therefore I'm looking for other possible library

EDIT: I made more testing and QR code it reads good, but 1D codes very rarely

gregkorossy commented 9 years ago

This might be a focus issue, try this fix until Google releases an update to the API which allows one to set the AF mode: https://gist.github.com/Gericop/7de0b9fdd7a444e53b5a

abhirav commented 9 years ago

Where can I find the callback method after barcoded is scanned? I want to pass barcode data to new screen, how can I do that?

pm0733464 commented 9 years ago

The callback method is delivered to an instance of Tracker via its onUpdate method. In the MultiTracker demo, this is in the GraphicTracker class. See also this question on stackoverflow:

http://stackoverflow.com/questions/32021193/how-to-capture-barcode-values-using-the-new-barcode-api-in-google-play-services/32029162#32029162

If you only need to handle barcodes in your app (and not faces), this could be simplified by changing GraphicTracker to inherit from Tracker rather than being generic.

abhirav commented 9 years ago

Thanks. It worked :).