Search code examples
androidandroid-vision

Android Mobile-Vision How to Improve Accuracy when selecting from multiple


I trying to determine if Google's Mobile-Vision API for reading barcodes is going to allow me to meet my requirements.

The problem I am facing currently is that I have a specific barcode that needs to be scanned. The barcode will be printed out next to other barcodes. The API is detecting the 3 barcodes as you can see in the image below: enter image description here

The problem is that when I try to select the middle barcode, either the top or bottom barcode data is returned to the onActivityResult from the sample app. So far I have tried to increment the setRequestedFps to 60. That only detects barcodes faster.

My question is, does anyone know how to improve the accuracy when the user selects from a group of barcodes as the image I have presented?

Any help will be greatly appreciated.


Solution

  • It looks like you're talking about the sample app, the source for which you can find here. Notice the TODO on line 335 (in onTap) -- unfortunately, the sample code just returns a random barcode result:

    https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/BarcodeCaptureActivity.java

    Try modifying the sample to select the barcode whose bounding rectangle contains the tap point.