Skip to main content

Classic UI for the Android Medical Certificate Scanner Module

Overview

Try our Medical Certificate Scanner example project or check the following step by step integration instructions.

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

Adding the feature dependencies and initializing the SDK

MedicalCertificateScanner 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:$latestSdkVersion")
implementation("io.scanbot:sdk-mc-assets:$latestSdkVersion")
implementation("io.scanbot:sdk-common-ocr-assets:$latestSdkVersion") // <<-- please also add this dependency
implementation("io.scanbot:io.scanbot:sdk-package-ui:$latestSdkVersion")

Some medical certificates contain additional information in the barcode. For such cases, you also have to add the dependency with the Barcode Scanner assets:

implementation("io.scanbot:sdk-barcode-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.

The Medical Certificate Scanner is based on the OCR feature of the Scanbot SDK. Please check the OCR documentation for more details.

In order to use the Medical Certificate Scanner 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:

Initialize SDK
loading...
caution

Unfortunately, we have noticed that all devices using a Cortex A53 processor DO NOT SUPPORT GPU acceleration. If you encounter any problems, please disable GPU acceleration for these devices.

ScanbotSDKInitializer()
.allowGpuAcceleration(false)

Adding ScanbotCameraXView to the layout

<io.scanbot.sdk.ui.camera.ScanbotCameraXView
android:id="@+id/camera_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />

Getting the MedicalCertificateScanner instance from ScanbotSDK and attaching it to ScanbotCameraXView

Attach Medical Certificate Scanner to ScanbotCameraXView
loading...

Adding a snapping result listener for IScanbotSdkView

Add snapping result listener
loading...

To detect full medical certificate information, you have to perform the certificate recognition on the snapped image.

Process the taken picture
loading...

If resultInfo is not null and resultInfo.recognitionSuccessful flag is true, then medical certificate content was successfully recognized.

As the result, you will get a MedicalCertificateScanningResult object that contains all extracted data:

  • checkBoxes: List<MedicalCertificateCheckBox>: list of the checkboxes with content types, states and confidence values
  • dates: List<MedicalCertificateDateRecord>: list of the MedicalCertificateDateRecord objects with recognized dates, date types, recognitionConfidenceValues and validationConfidenceValues
  • patientInfoBox: zone of patient info:
    • patientInfoFields: List<MedicalCertificatePatientInfoBox>: list of the MedicalCertificatePatientInfoBox objects with information about the patient, recognitionConfidenceValues and validationConfidenceValues
  • formType: MedicalCertificateFormType: type of the medical certificate

Adding a finder overlay

In addition, it is also possible to add a finder overlay. This feature allows you to predefine a medical certificate document area over the ScanbotCameraXView screen. By using this overlay, the Medical Certificate Scanner can skip the time-consuming step of searching for a medical certificate area and perform the recognition directly in the specified finder overlay area. By using this approach, the Medical Certificate Scanner recognizes the document and extracts the content much faster.

Details about applying finder view logic in the layout and in the code can be found here.

Want to scan longer than one minute?

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

Get free trial license