Kotlin
Capturing an Image for OCR
Vision SDK provides a simple way to capture images for further processing like OCR or just for saving in storage. All you need to do is follow the setup steps below.
Capture Image
Using the following code, you can get image as a bitmap in onImageCaptured
callback, along with a list of ScannedCodeResult
. The list will contain any barcodes that were available in that bitmap. The list could be empty, if there were no barcodes found.
Note that, once onScanResult
or onImageCaptured
callbacks are called, VisionSDK will stop analyzing camera feed for text or barcodes/QR codes.
This is to prevent extra processing and battery consumption. When client wants to start analyzing camera feed again, after consuming the results of previous scan, client needs to call the following function: