1

I successfully implemented the multi-detector to recognize barcode and text at the same time by modifying the sample code given from https://developers.google.com/vision/android/multi-tracker-tutorial.

Here is the complete code on my Git: https://github.com/ferrydjaja/multi-tracker/blob/master/app/src/main/java/com/google/android/gms/samples/vision/face/multitracker/MultiTrackerActivity.java

MultiDetector multiDetector = new MultiDetector.Builder()
            //.add(faceDetector)
            .add(barcodeDetector)
            .add(textRecognizer)
            .build();

On https://github.com/ferrydjaja/multi-tracker/blob/master/app/src/main/java/com/google/android/gms/samples/vision/face/multitracker/BarcodeTrackerFactory.java

 void updateItem(Barcode barcode) {
    Log.d("FD", "Barcode:" + barcode.rawValue);
    mBarcode = barcode;
    postInvalidate();
}

On https://github.com/ferrydjaja/multi-tracker/blob/master/app/src/main/java/com/google/android/gms/samples/vision/face/multitracker/OcrTrackerFactory.java

 void updateItem(TextBlock text) {
    Log.d("FD", "TextFD:" + text.getValue());

    mText = text;
    postInvalidate();
}

The issue now is how to start a new activity once the barcode and text are recognize, that allows a user to verify value and on the push of a button call a webservice to post values of barcode and text?

user3736228
  • 273
  • 3
  • 18

0 Answers0