Scanning use cases
Added in BlinkID Web v8003.0.0, and in BlinkID Android and iOS v8002.0.0. Earlier v8xxx versions don't have use cases; configure session settings and scanning settings directly instead.
BlinkID has more than 30 scanning settings. Instead of setting them one by one, you can describe your use case and let BlinkID build the matching session settings for you.
You can override individual settings before you start the scanning session.
Use cases
We offer the following main use cases:
- Document video: live document scanning from a camera stream.
- Document photo: document scanning from a single photo or gallery image.
- Standalone barcode: barcode scanning without document detection.
- Verify capture: live camera capture for images you send to BlinkID Verify.
Use cases are represented by their corresponding builders, functions which return the final session settings.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
The builders are functions on the core instance returned by loadBlinkIdCore, and on the presetBuilder that createBlinkId passes to presetScanningSettingsBuilder.
Each returns a promise that resolves to the session settings.
- Document video:
buildDocumentVideoSettings(useCase?: DocumentVideoUseCase) - Document photo:
buildDocumentPhotoSettings(useCase?: DocumentPhotoUseCase) - Standalone barcode:
buildStandaloneBarcodeSettings() - Verify capture:
buildVerifyCaptureSettings()
The builders are functions on the BlinkIdSessionSettings companion object, and return a BlinkIdSessionSettings.
The use case classes and enums are in the com.microblink.blinkid.core.settings.usecase package.
- Document video:
BlinkIdSessionSettings.documentVideo(useCase: DocumentVideoUseCase = DocumentVideoUseCase()) - Document photo:
BlinkIdSessionSettings.documentPhoto(useCase: DocumentPhotoUseCase = DocumentPhotoUseCase()) - Standalone barcode:
BlinkIdSessionSettings.standaloneBarcode() - Verify capture:
BlinkIdSessionSettings.verifyCapture()
The builders are static functions on BlinkIDSessionSettings, and return a BlinkIDSessionSettings.
- Document video:
BlinkIDSessionSettings.documentVideo(_ useCase: DocumentVideoUseCase = DocumentVideoUseCase()) - Document photo:
BlinkIDSessionSettings.documentPhoto(_ useCase: DocumentPhotoUseCase = DocumentPhotoUseCase()) - Standalone barcode:
BlinkIDSessionSettings.standaloneBarcode() - Verify capture:
BlinkIDSessionSettings.verifyCapture()
Build session settings from a use case
Pass a use case object to the builder. Every option is optional; options you leave out use their default value.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
With the @microblink/blinkid package, pass presetScanningSettingsBuilder to createBlinkId.
The callback receives a builder that exposes the four builder functions.
You can't combine presetScanningSettingsBuilder with the scanningSettings and scanningMode options.
import { createBlinkId } from "@microblink/blinkid";
const blinkId = await createBlinkId({
licenseKey: "your-license-key",
presetScanningSettingsBuilder: (presetBuilder) =>
presetBuilder.buildDocumentVideoSettings({
scenario: "mrz-mandatory",
quality: "high-accuracy",
}),
});
With the @microblink/blinkid-core package, the builder functions are available on the loaded core instance.
Pass the result to createScanningSession:
import { loadBlinkIdCore } from "@microblink/blinkid-core";
const blinkIdCore = await loadBlinkIdCore({ licenseKey: "your-license-key" });
const sessionSettings = await blinkIdCore.buildDocumentVideoSettings({
scenario: "mrz-mandatory",
quality: "high-accuracy",
});
const session = await blinkIdCore.createScanningSession(sessionSettings);
import com.microblink.blinkid.core.session.BlinkIdSessionSettings
import com.microblink.blinkid.core.settings.usecase.DocumentScenario
import com.microblink.blinkid.core.settings.usecase.DocumentVideoUseCase
import com.microblink.blinkid.core.settings.usecase.VideoQualityProfile
val sessionSettings = BlinkIdSessionSettings.documentVideo(
DocumentVideoUseCase(
scenario = DocumentScenario.MrzMandatory,
quality = VideoQualityProfile.HighAccuracy,
)
)
BlinkIdCameraScanningScreen(
blinkIdSdk = blinkIdSdk,
sessionSettings = sessionSettings,
onScanningSuccess = { result -> /* handle result */ },
onScanningCanceled = { }
)
let sessionSettings = BlinkIDSessionSettings.documentVideo(
DocumentVideoUseCase(
scenario: .mrzMandatory,
quality: .highAccuracy
)
)
let analyzer = try await BlinkIDAnalyzer(
sdk: sdk,
blinkIdSessionSettings: sessionSettings
)
Options
The document video use case has three options: scenario, quality, and captureEnvironment.
The document photo use case has two: scenario and quality.
The standalone barcode and Verify capture builders take no options.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
scenario
type:
DocumentScenario, default:"general"
Available in DocumentVideoUseCase and DocumentPhotoUseCase.
Selects which extraction modules run, and what must be present for a successful scan.
Document capture is always enabled.
"general": standard ID scanning with all modules enabled"mrz-mandatory": the scan only completes if an MRZ is present; VIZ and barcode are still read"mrz-only": single-side scan that reads only the MRZ"barcode-only": single-side scan that reads only the barcode of a detected document
quality (video)
type:
VideoQualityProfile, default:"balanced"
Available in DocumentVideoUseCase.
Selects the trade-off between capture speed and result accuracy.
"balanced": default balance between capture speed and result accuracy"high-speed": selects the fastest acceptable frame and lowers blur, glare, and tilt sensitivity"high-accuracy": raises quality thresholds, requires a face image, and reads the VIZ from a single best frame instead of combining multiple frames"permissive": lowers quality thresholds and accepts frames with blur, glare, poor lighting, or hand occlusion
quality (photo)
type:
PhotoQualityProfile, default:"balanced"
Available in DocumentPhotoUseCase.
Selects the trade-off between result accuracy and tolerance for lower-quality input.
"balanced": default quality settings for photo input"high-accuracy": raises quality thresholds and requires a face image"permissive": lowers quality thresholds, accepts images with quality issues, and turns off VIZ character validation
captureEnvironment
type:
VideoCaptureEnvironment, default:"hand-held"
Available in DocumentVideoUseCase.
Describes the physical setup of the camera.
"hand-held": a hand-held mobile camera"stationary": a fixed camera, such as a kiosk; the document may reach the edge of the frame
scenario
type:
DocumentScenario, default:DocumentScenario.General
Available in DocumentVideoUseCase and DocumentPhotoUseCase.
Selects which extraction modules run, and what must be present for a successful scan.
Document capture is always enabled.
General: standard ID scanning with all modules enabledMrzMandatory: the scan only completes if an MRZ is present; VIZ and barcode are still readMrzOnly: single-side scan that reads only the MRZBarcodeOnly: single-side scan that reads only the barcode of a detected document
quality (video)
type:
VideoQualityProfile, default:VideoQualityProfile.Balanced
Available in DocumentVideoUseCase.
Selects the trade-off between capture speed and result accuracy.
Balanced: default balance between capture speed and result accuracyHighSpeed: selects the fastest acceptable frame and lowers blur, glare, and tilt sensitivityHighAccuracy: raises quality thresholds, requires a face image, and reads the VIZ from a single best frame instead of combining multiple framesPermissive: lowers quality thresholds and accepts frames with blur, glare, poor lighting, or hand occlusion
quality (photo)
type:
PhotoQualityProfile, default:PhotoQualityProfile.Balanced
Available in DocumentPhotoUseCase.
Selects the trade-off between result accuracy and tolerance for lower-quality input.
Balanced: default quality settings for photo inputHighAccuracy: raises quality thresholds and requires a face imagePermissive: lowers quality thresholds, accepts images with quality issues, and turns off VIZ character validation
captureEnvironment
type:
VideoCaptureEnvironment, default:VideoCaptureEnvironment.HandHeld
Available in DocumentVideoUseCase.
Describes the physical setup of the camera.
HandHeld: a hand-held mobile cameraStationary: a fixed camera, such as a kiosk; the document may reach the edge of the frame
scenario
type:
DocumentScenario, default:.general
Available in DocumentVideoUseCase and DocumentPhotoUseCase.
Selects which extraction modules run, and what must be present for a successful scan.
Document capture is always enabled.
.general: standard ID scanning with all modules enabled.mrzMandatory: the scan only completes if an MRZ is present; VIZ and barcode are still read.mrzOnly: single-side scan that reads only the MRZ.barcodeOnly: single-side scan that reads only the barcode of a detected document
quality (video)
type:
VideoQualityProfile, default:.balanced
Available in DocumentVideoUseCase.
Selects the trade-off between capture speed and result accuracy.
.balanced: default balance between capture speed and result accuracy.highSpeed: selects the fastest acceptable frame and lowers blur, glare, and tilt sensitivity.highAccuracy: raises quality thresholds, requires a face image, and reads the VIZ from a single best frame instead of combining multiple frames.permissive: lowers quality thresholds and accepts frames with blur, glare, poor lighting, or hand occlusion
quality (photo)
type:
PhotoQualityProfile, default:.balanced
Available in DocumentPhotoUseCase.
Selects the trade-off between result accuracy and tolerance for lower-quality input.
.balanced: default quality settings for photo input.highAccuracy: raises quality thresholds and requires a face image.permissive: lowers quality thresholds, accepts images with quality issues, and turns off VIZ character validation
captureEnvironment
type:
VideoCaptureEnvironment, default:.handHeld
Available in DocumentVideoUseCase.
Describes the physical setup of the camera.
.handHeld: a hand-held mobile camera.stationary: a fixed camera, such as a kiosk; the document may reach the edge of the frame
The barcode-only scenario still detects the document and reads its barcode. To read barcodes directly from the frame, without detecting a document, use the standalone barcode builder instead.
Settings applied by each option
Each builder starts from the default session settings and changes only the settings listed below.
All other settings keep their default values.
Unless stated otherwise, the quality settings are in documentCaptureModule.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
Scenario
"general": no changes"mrz-mandatory":scanningMode:"automatic"mrzModule.presenceMandatory:true
"mrz-only":scanningMode:"single"vizModule:nullbarcodeModule:nullmrzModule.presenceMandatory:true
"barcode-only":scanningMode:"single"vizModule:nullmrzModule:nullbarcodeModule.presenceMandatory:true
Video quality
"balanced": no changes"high-speed":inputImageSelectionStrategy:"optimize-for-speed"blurSensitivityLevel:"low"glareSensitivityLevel:"low"tiltSensitivityLevel:"low"
"high-accuracy":inputImageSelectionStrategy:"optimize-for-quality"dotsPerInch:400blurSensitivityLevel:"high"glareSensitivityLevel:"high"tiltSensitivityLevel:"high"faceImageExtractionEnabled:truefaceImagePresenceMandatory:truevizModule.resultAggregationEnabled:false
"permissive":inputImageSelectionStrategy:"single-image"blurSensitivityLevel:"low"glareSensitivityLevel:"low"tiltSensitivityLevel:"low"imageWithBlurRejected:falseimageWithGlareRejected:falseimageWithPoorLightingRejected:falseimageWithHandOcclusionRejected:false
Photo quality
The document photo builder always sets inputImageSource to "photo".
"balanced": no other changes"high-accuracy":dotsPerInch:400blurSensitivityLevel:"high"glareSensitivityLevel:"high"tiltSensitivityLevel:"high"faceImageExtractionEnabled:truefaceImagePresenceMandatory:true
"permissive":cropType:"unknown"blurSensitivityLevel:"low"glareSensitivityLevel:"low"tiltSensitivityLevel:"off"imageWithBlurRejected:falseimageWithGlareRejected:falseimageWithPoorLightingRejected:falseimageWithHandOcclusionRejected:falsevizModule.characterValidationEnabled:false
Capture environment
"hand-held": no changes"stationary":documentCaptureModule.inputImageMargin:0.0
Standalone barcode
scanningMode:"single"documentCaptureModule:nullvizModule:nullmrzModule:nullbarcodeModule.presenceMandatory:true- all barcode formats enabled: PDF417, QR, UPC-A, UPC-E, EAN-8, EAN-13, Code 128, Code 39, ITF, Data Matrix, and Aztec
Verify capture
Starts from the default document video settings ("general", "balanced", "hand-held"), then sets:
documentCaptureModule.faceImageExtractionEnabled:truedocumentCaptureModule.inputImageReturnEnabled:truevizModule.resultAggregationEnabled:falsebarcodeModule.barcodeImageReturnEnabled:true
Scenario
General: no changesMrzMandatory:scanningMode:ScanningMode.AutomaticmrzModule.presenceMandatory:true
MrzOnly:scanningMode:ScanningMode.SinglevizModule:nullbarcodeModule:nullmrzModule.presenceMandatory:true
BarcodeOnly:scanningMode:ScanningMode.SinglevizModule:nullmrzModule:nullbarcodeModule.presenceMandatory:true
Video quality
Balanced: no changesHighSpeed:inputImageSelectionStrategy:InputImageSelectionStrategy.OptimizeForSpeedblurSensitivityLevel:SensitivityLevel.LowglareSensitivityLevel:SensitivityLevel.LowtiltSensitivityLevel:SensitivityLevel.Low
HighAccuracy:inputImageSelectionStrategy:InputImageSelectionStrategy.OptimizeForQualitydotsPerInch:400blurSensitivityLevel:SensitivityLevel.HighglareSensitivityLevel:SensitivityLevel.HightiltSensitivityLevel:SensitivityLevel.HighfaceImageExtractionEnabled:truefaceImagePresenceMandatory:truevizModule.resultAggregationEnabled:false
Permissive:inputImageSelectionStrategy:InputImageSelectionStrategy.SingleImageblurSensitivityLevel:SensitivityLevel.LowglareSensitivityLevel:SensitivityLevel.LowtiltSensitivityLevel:SensitivityLevel.LowimageWithBlurRejected:falseimageWithGlareRejected:falseimageWithPoorLightingRejected:falseimageWithHandOcclusionRejected:false
Photo quality
The document photo builder always sets inputImageSource to InputImageSource.Photo.
Balanced: no other changesHighAccuracy:dotsPerInch:400blurSensitivityLevel:SensitivityLevel.HighglareSensitivityLevel:SensitivityLevel.HightiltSensitivityLevel:SensitivityLevel.HighfaceImageExtractionEnabled:truefaceImagePresenceMandatory:true
Permissive:cropType:InputImageCropType.UnknownblurSensitivityLevel:SensitivityLevel.LowglareSensitivityLevel:SensitivityLevel.LowtiltSensitivityLevel:SensitivityLevel.OffimageWithBlurRejected:falseimageWithGlareRejected:falseimageWithPoorLightingRejected:falseimageWithHandOcclusionRejected:falsevizModule.characterValidationEnabled:false
Capture environment
HandHeld: no changesStationary:documentCaptureModule.inputImageMargin:0.0f
Standalone barcode
scanningMode:ScanningMode.SingledocumentCaptureModule:nullvizModule:nullmrzModule:nullbarcodeModule.presenceMandatory:true- all barcode formats enabled: PDF417, QR, UPC-A, UPC-E, EAN-8, EAN-13, Code 128, Code 39, ITF, Data Matrix, and Aztec
Verify capture
Starts from the default document video settings (General, Balanced, HandHeld), then sets:
documentCaptureModule.faceImageExtractionEnabled:truedocumentCaptureModule.inputImageReturnEnabled:truevizModule.resultAggregationEnabled:falsebarcodeModule.barcodeImageReturnEnabled:true
Scenario
.general: no changes.mrzMandatory:scanningMode:.automaticmrzModule.presenceMandatory:true
.mrzOnly:scanningMode:.singlevizModule:nilbarcodeModule:nilmrzModule.presenceMandatory:true
.barcodeOnly:scanningMode:.singlevizModule:nilmrzModule:nilbarcodeModule.presenceMandatory:true
Video quality
.balanced: no changes.highSpeed:inputImageSelectionStrategy:.optimizeForSpeedblurSensitivityLevel:.lowglareSensitivityLevel:.lowtiltSensitivityLevel:.low
.highAccuracy:inputImageSelectionStrategy:.optimizeForQualitydotsPerInch:400blurSensitivityLevel:.highglareSensitivityLevel:.hightiltSensitivityLevel:.highfaceImageExtractionEnabled:truefaceImagePresenceMandatory:truevizModule.resultAggregationEnabled:false
.permissive:inputImageSelectionStrategy:.singleImageblurSensitivityLevel:.lowglareSensitivityLevel:.lowtiltSensitivityLevel:.lowimageWithBlurRejected:falseimageWithGlareRejected:falseimageWithPoorLightingRejected:falseimageWithHandOcclusionRejected:false
Photo quality
The document photo builder always sets inputImageSource to .photo.
.balanced: no other changes.highAccuracy:dotsPerInch:400blurSensitivityLevel:.highglareSensitivityLevel:.hightiltSensitivityLevel:.highfaceImageExtractionEnabled:truefaceImagePresenceMandatory:true
.permissive:cropType:.unknownblurSensitivityLevel:.lowglareSensitivityLevel:.lowtiltSensitivityLevel:.offimageWithBlurRejected:falseimageWithGlareRejected:falseimageWithPoorLightingRejected:falseimageWithHandOcclusionRejected:falsevizModule.characterValidationEnabled:false
Capture environment
.handHeld: no changes.stationary:documentCaptureModule.inputImageMargin:0.0
Standalone barcode
scanningMode:.singledocumentCaptureModule:nilvizModule:nilmrzModule:nilbarcodeModule.presenceMandatory:true- all barcode formats enabled: PDF417, QR, UPC-A, UPC-E, EAN-8, EAN-13, Code 128, Code 39, ITF, Data Matrix, and Aztec
Verify capture
Starts from the default document video settings (.general, .balanced, .handHeld), then sets:
documentCaptureModule.faceImageExtractionEnabled:truedocumentCaptureModule.inputImageReturnEnabled:truevizModule.resultAggregationEnabled:falsebarcodeModule.barcodeImageReturnEnabled:true
Change individual settings
The builders return regular session settings, so you can change any setting before you start the session. The following example starts from the default document video settings and also returns the cropped document image.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
import { createBlinkId } from "@microblink/blinkid";
const blinkId = await createBlinkId({
licenseKey: "your-license-key",
presetScanningSettingsBuilder: async (presetBuilder) => {
const settings = await presetBuilder.buildDocumentVideoSettings();
return {
...settings,
scanningSettings: {
...settings.scanningSettings,
documentCaptureModule: {
...settings.scanningSettings.documentCaptureModule,
documentImageReturnEnabled: true,
},
},
};
},
});
val baseSettings = BlinkIdSessionSettings.documentVideo()
val sessionSettings = baseSettings.copy(
scanningSettings = baseSettings.scanningSettings.copy(
documentCaptureModule = baseSettings.scanningSettings.documentCaptureModule?.copy(
documentImageReturnEnabled = true
)
)
)
var sessionSettings = BlinkIDSessionSettings.documentVideo()
sessionSettings.scanningSettings.documentCaptureModule?.documentImageReturnEnabled = true
Changed settings are still subject to settings validation.