I am integrating the Google Vision API into my existing Android app. the application recognizes QR codes, but I need to implement a user interface function, where the user is shown a graphic outline above the bar code.
This sample code includes showing a graphic outline above a barcode:
https://github.com/googlesamples/android-vision/tree/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader
The relationship between the detector and the graphics is as follows:
mGraphicOverlay = (GraphicOverlay<BarcodeGraphic>) findViewById(R.id.graphicOverlay); // A barcode detector is created to track barcodes. An associated multi-processor instance // is set to receive the barcode detection results, track the barcodes, and maintain // graphics for each barcode on screen. The factory is used by the multi-processor to // create a separate tracker instance for each barcode. BarcodeDetector barcodeDetector = new BarcodeDetector.Builder(context).build(); BarcodeTrackerFactory barcodeFactory = new BarcodeTrackerFactory(mGraphicOverlay); barcodeDetector.setProcessor( new MultiProcessor.Builder<>(barcodeFactory).build());
GraphicOverlay . , . :
https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/ui/camera/GraphicOverlay.java
- factory , -. . BarcodeGraphic, :
https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/BarcodeGraphic.java
Source: https://habr.com/ru/post/1626799/More articles:Pubnub - removing a large number of channels from multiple channel groups - javascriptShuffling an array of strings in vb.net - arraysEF6 Connection string in Azure - azure-sql-databaseASP.NET MVC5 Elmah Error Log / Email Controller for path not found - c #Find the cost of an ellipse in OpenCV - c ++How to get Eclipse-Che on Amazon EC2? - eclipseAvoid shared lists in the base class. Do I have to follow one rule for a dictionary? - dictionarySpark, почему рабочий автоматически запускается на моем хозяине - apache-sparkHow to configure HeaderCommentFixer in PHP-CS-Fixer - phpRepair corrupted neo4j database (2.3.2 community) - neo4jAll Articles