Skip to main content

Scanning a check from an image file with the Android Check Scanner Module

In addition to extracting check data from a live camera stream, the SDK can scan checks from still images imported from the gallery or any other source.

Integration

To see the complete integration and the Check Scanner in action, example apps are available:

Adding the feature as a dependency

CheckScanner is included in Scanbot SDK package 4. Therefore, add the dependency io.scanbot:sdk-package-4 or higher in your build.gradle:

implementation("io.scanbot:sdk-package-4:$latestVersion")
implementation("io.scanbot:sdk-check-assets:$latestSdkVersion")
caution

Do not use multiple scanners (e.g., MRZ Scanner and Credit Card Scanner) at the same time.

Each scanner instance requires a lot of memory, GPU, and processor resources. Using multiple scanners will lead to performance issues for the entire application.

Initializing the SDK

Before use, the Scanbot SDK needs to be initialized. The following code snippet should be added to your Application class:

import io.scanbot.sdk.ScanbotSDKInitializer

class ExampleApplication : Application() {

override fun onCreate() {
super.onCreate()

// The Scanbot Scanner SDK initialization:
ScanbotSDKInitializer()
...
.initialize(this)
}
}

Processing the image

To select an image from the photo library and run detection on it, a class for an image import contract is created using the modern Android result API.

Import image Contract
loading...

To run the gallery call and get a Bitmap using ImportImageContract, the following code is used:

Import image launcher
loading...

Creating a scanner

  val scanbotSDK = ScanbotSDK(this)
val checkScanner = scanbotSDK.createCheckScanner()
caution

Each call to createCheckScanner() will create a new CheckScanner and initialize memory for it. If more than one import operation is expected, do not create new scanners for each operation.

Detection

The Scanbot SDK is used to detect the desired element on the imported image.

Extracting check data from an image
loading...

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license