Skip to main content

Using DC Scanner | Android Document Scanner

The Scanbot SDK provides the ability to find and extract content from German Disability Certificates (DC / AU-Bescheinigung) forms.

The following fields can be extracted:

  • Checkboxes:
    • Initial Certificate (Erstbescheinigung)
    • Renewed Certificate (Folgebescheinigung)
    • Work Accident (Arbeitsunfall, Arbeitsunfallfolgen, Berufskrankheit)
    • Assigned To Accident Insurance Doctor (dem Durchgangsarzt zugewiesen)
  • Date Fields:
    • Incapable Since (arbeitsunfähig seit)
    • Incapable Until (voraussichtlich arbeitsunfähig bis ...)
    • Diagnosed On (festgestellt am)

Try our DC Scanner Example Apps or check the following step by step integration instructions.

Step 1 - Add DC Feature as a Dependency#

DCScanner is available with the SDK Package 4. You have to add the following dependencies for it:

implementation "io.scanbot:sdk-package-4:$latestVersion"implementation "io.scanbot:sdk-dc-assets:$latestVersion"

It can be used in conjunction with ScanbotCameraView or separately. Let's have a look at an example with ScanbotCameraView.

Step 2 - Prepare the OCR language blob file and DC Blobs#

The DC Recognizer is based on the OCR feature of Scanbot SDK. Please check the [[Optical-Character-Recognition]] docs for more details.

In order to use the DC Recognizer you need to prepare the English OCR language file. Place the eng.traineddata file in the assets sub-folder assets/ocr_blobs/ of your app.

Then on initialization of the SDK call the prepareOCRLanguagesBlobs(true) method:

import io.scanbot.sdk.ScanbotSDKInitializer
    ...
    ScanbotSDKInitializer()        .prepareOCRLanguagesBlobs(true)        // ...        .initialize(this)

Step 3 - Get DCScanner instance from ScanbotSDK and attach it to ScanbotCameraView#

val scanbotSDK = ScanbotSDK(this)val dcScanner: DCScanner = scanbotSDK.createDcScanner()val dcScannerFrameHandler: DCScannerFrameHandler = DCScannerFrameHandler.attach(cameraView, dcScanner)

Step 4 - Add result handler for DCScannerFrameHandler#

dcScannerFrameHandler.addResultHandler { result ->    when (result) {        is FrameHandlerResult.Success -> {            // to do something with result here result.value        }        is FrameHandlerResult.Failure -> {            // handle license problem here result.error        }    }    false}

handle will be triggered every time DCScanner detects document content in the camera preview frame or if a license error occurred. If result.value is not null and result.value.recognitionSuccessful flag is true then DC content was successfully recognised.

As a result you will get a DisabilityCertificateRecognizerResultInfo object that contains all extracted data:

  • DisabilityCertificateInfoBox checkboxes with content types, states and confidence values
  • List of DateRecord objects with recognised dates, date types, recognitionConfidenceValues and validationConfidenceValues