SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. private void runDetector(Bitmap bitmap) {
  2.         FirebaseVisionImage image = FirebaseVisionImage.fromBitmap(bitmap);
  3.         FirebaseVisionBarcodeDetectorOptions options = new FirebaseVisionBarcodeDetectorOptions.Builder().setBarcodeFormats(FirebaseVisionBarcode.FORMAT_QR_CODE,FirebaseVisionBarcode.FORMAT_AZTEC).build();
  4.         FirebaseVisionBarcodeDetector detector = FirebaseVision.getInstance().getVisionBarcodeDetector(options);
  5.  
  6.         Log.d("VVV_IMG","is "+image);
  7.         detector.detectInImage(image).addOnSuccessListener(new OnSuccessListener<List<FirebaseVisionBarcode>>() {
  8.             @Override
  9.             public void onSuccess(List<FirebaseVisionBarcode> firebaseVisionBarcodes) {
  10.                     Log.d("VVVVVV","is "+firebaseVisionBarcodes);
  11.  
  12.                     processResult(firebaseVisionBarcodes);
  13.             }
  14.  
  15.         })
  16.                 .addOnFailureListener(new OnFailureListener() {
  17.                     @Override
  18.                     public void onFailure(@NonNull Exception e) {
  19.  
  20.                         Toast.makeText(MainActivity.this,e.getMessage(),Toast.LENGTH_SHORT).show();
  21.                     }
  22.                 });
  23.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top