ScanningSettings

data class ScanningSettings(val blurDetectionLevel: DetectionLevel = DetectionLevel.Mid, val skipImagesWithBlur: Boolean = true, val glareDetectionLevel: DetectionLevel = DetectionLevel.Mid, val skipImagesWithGlare: Boolean = true, val tiltDetectionLevel: DetectionLevel = DetectionLevel.Off, val skipImagesWithInadequateLightingConditions: Boolean = false, val skipImagesOccludedByHand: Boolean = false, val combineResultsFromMultipleInputImages: Boolean = true, val enableBarcodeScanOnly: Boolean = false, val customDocumentRules: List<DocumentRules> = emptyList(), val anonymizationMode: AnonymizationMode = AnonymizationMode.FullResult, val customDocumentAnonymizationSettings: List<DocumentAnonymizationSettings> = emptyList(), val returnInputImages: Boolean = false, val scanCroppedDocumentImage: Boolean = false, val recognitionModeFilter: RecognitionModeFilter = RecognitionModeFilter(), val enableCharacterValidation: Boolean = true, @FloatRange(from = 0.0, to = 1.0) val inputImageMargin: Float = 0.02f, val scanUnsupportedBack: Boolean = false, val allowUncertainFrontSideScan: Boolean = false, val maxAllowedMismatchesPerField: UInt, val scanPassportDataPageOnly: Boolean = true, val croppedImageSettings: CroppedImageSettings = CroppedImageSettings()) : Parcelable

Represents the configurable settings for scanning a document.

This structure defines various parameters and policies related to the scanning process, including image quality handling, data extraction and anonymization, along with options for frame processing and image extraction.

Constructors

Link copied to clipboard
constructor(blurDetectionLevel: DetectionLevel = DetectionLevel.Mid, skipImagesWithBlur: Boolean = true, glareDetectionLevel: DetectionLevel = DetectionLevel.Mid, skipImagesWithGlare: Boolean = true, tiltDetectionLevel: DetectionLevel = DetectionLevel.Off, skipImagesWithInadequateLightingConditions: Boolean = false, skipImagesOccludedByHand: Boolean = false, combineResultsFromMultipleInputImages: Boolean = true, enableBarcodeScanOnly: Boolean = false, customDocumentRules: List<DocumentRules> = emptyList(), anonymizationMode: AnonymizationMode = AnonymizationMode.FullResult, customDocumentAnonymizationSettings: List<DocumentAnonymizationSettings> = emptyList(), returnInputImages: Boolean = false, scanCroppedDocumentImage: Boolean = false, recognitionModeFilter: RecognitionModeFilter = RecognitionModeFilter(), enableCharacterValidation: Boolean = true, @FloatRange(from = 0.0, to = 1.0) inputImageMargin: Float = 0.02f, scanUnsupportedBack: Boolean = false, allowUncertainFrontSideScan: Boolean = false, maxAllowedMismatchesPerField: UInt, scanPassportDataPageOnly: Boolean = true, croppedImageSettings: CroppedImageSettings = CroppedImageSettings())

Properties

Link copied to clipboard

Indicates whether scanning can continue to the next side despite an uncertain front-side scan. This only applies to images from Photo input image source - for images from Video source, setting will be ignored.

Link copied to clipboard

The mode of anonymization applied to the document. Redact specific fields based on requirements or laws regarding a specific document. Data can be redacted from the image, the result or both.

Link copied to clipboard

Defines the severity of blur detected in the document image, as defined in DetectionLevel. Values range from Off (detection NotAvailable) to higher levels of blur detection. Low – less sensitive to blur; if something is detected as blur, it is almost certainly actual blur, but some amount of blur may not be detected at all. High – highly sensitive to blur; it may detect as blur even something that only resembles blur.

Link copied to clipboard

Indicates whether the aggregation of data from multiple images is enabled. Disabling this setting will yield higher-quality captured images, but it may slow down the scanning process due to the additional effort required to find the optimal image. Enabling this setting will simplify the extraction process, but the extracted data will be aggregated from multiple images instead of being sourced from a single image. This only applies to images from Video input image source - for images from Photo source, setting will be ignored.

Link copied to clipboard

Configures the image cropping options during scanning process. Allows customization of cropped image handling, such as dotsPerInch, extensionFactor, and whether images should be returned for the entire document, face or signature regions.

Link copied to clipboard

Redact fields for specific document class. Fields specified by requirements or laws for a specific document will be redacted regardless of this setting. Based on anonymizationMode setting, data will be redacted from the image, the result or both.

Link copied to clipboard

Defines custom rules for specific document class. When defining customDocumentRules, documentFilter is optionally set to specify the document to which the rule applies, and a fields with the appropriate alphabetType should be specified as mandatory for that document. If a fields is set to a field that is optional for that document or does not exist on it, all fields on the document become optional. If a fields is set to a field with an incorrect alphabetType, all fields on the document become optional. If a fields is set to a field that doesn’t exist in the internal rules, that rule is ignored. When adding multiple fields, any field that does not match our rules is ignored. Only fields that comply with our rules are set as mandatory. If the documentFilter fields country, region, or type are set to null, all supported values for those fields will be considered. For example, if country = null, the rule will apply to all supported countries in BlinkID. By default, document fields are validated using internal rules that define mandatory fields for the scanned document class. This setting allows users to narrow down our internal rules on mandatory fields. All undefined fields will become optional. It is not possible to mark fields as mandatory if they cannot theoretically appear on the document. The more detailed document filter will have priority over the other.

Link copied to clipboard

Enables barcode recognition to proceed even if the initial VIZ extraction fails. If the barcode recognition is successful, the recognizer will still end in a valid state. This setting is applicable only to images from Photo source. For multi-side scanning, it is permitted only for the back side.

Link copied to clipboard

Indicates whether character validation is enabled. Allow only results containing expected characters for a given field. Each field is validated against a set of rules. All fields have to be successfully validated in order to successfully scan a document. Setting is used to improve scanning accuracy. If set to true, when an invalid character is detected ProcessingStatus::InvalidCharactersFound is returned.

Link copied to clipboard

The level of glare detection in the document image. Defines the severity of glare detected in the document image, as defined in DetectionLevel. Values range from Off (detection NotAvailable) to higher levels of glare detection. Low – less sensitive to glare; if something is detected as glare, it is almost certainly actual glare, but some amount of glare may not be detected at all. High – highly sensitive to glare; it may detect as glare even something that only resembles glare.

Link copied to clipboard
val inputImageMargin: Float = 0.02f

Defines the minimum required margin (in percentage) between the edge of the input image and the document. Default value is 0.02f (also recommended value). The setting is applicable only when using images from Video source The setting is not applicable if scanCroppedDocumentImage = true (it will be ignored). This setting is implemented to comply with regulations in certain countries that mandate documents to be stored with adequate margins in the image.

Link copied to clipboard

The maximum allowed mismatches per field during data matching. Configures the maximum number of characters per field that can be inconsistent during data matching. By default, no mismatches are allowed.

Link copied to clipboard
@ApiStatus.Experimental
val recognitionModeFilter: RecognitionModeFilter

The filter for recognition modes. Specifies which recognition modes are enabled during the scanning process, with a default value of true to enable all modes. RecognitionModeFilter is used to enable/disable recognition of specific document groups. This setting is experimental and it will be removed in upcoming releases.

Link copied to clipboard

Indicates whether input images should be returned. Save the input images at the moment of the data extraction or timeout. This significantly increases memory consumption. The scanning performance is not affected.

Link copied to clipboard

Process only cropped document images. Requires the input image to consist solely of the cropped document image with perspective correction applied. This only applies to images from Photo input image source - for images from Video input image source, setting will be ignored.

Link copied to clipboard

Indicates whether only the passport data page should be scanned. Scan only the data page ( page containing MRZ ) of the passport. If set to false, it will be required to scan the second page of certain passports.

Link copied to clipboard

Indicates whether backside of unsupported document should be scanned also. By default, back side of the document will not be scanned if only the front side is supported for a specific document.

Link copied to clipboard

Indicates whether images occluded by hand should be rejected. A value of true means images occluded by hand will be excluded from further processing to prevent occluded images from being used - If hand occlusion is detected ProcessingStatus will be ImagePreprocessingFailed and hand occlusion status will be reported in the ProcessResult This setting is applicable only if scanCroppedDocumentImage = false.

Link copied to clipboard

Indicates whether images with blur in the document image should be skipped. A value of true means images with detected blur will be excluded from further processing to prevent blurred images from being used - If blurDetectionLevel = Off - blurred images will be processed - If blur is detected ProcessingStatus will be ImagePreprocessingFailed and blur will be reported in the ProcessResult A value of false means images with detected blur will not be excluded from further processing - If blurDetectionLevel != Off - even if blur is detected, the image will be processed and blur will be reported in the ProcessResult.

Link copied to clipboard

Indicates whether images with glare in the document image should be skipped. A value of true means images with detected glare will be excluded from further processing to prevent glared images from being used - If glareDetectionLevel = Off - glared images will be processed - If glare is detected ProcessingStatus will be ImagePreprocessingFailed and glare will be reported in the ProcessResult A value of false means images with detected glare will not be excluded from further processing - If glareDetectionLevel != Off - even if glare is detected, the image will be processed and glare will be reported in the ProcessResult

Indicates whether images with inadequate lighting conditions should be rejected. Inadequate lighting conditions are represented as either TooBright or TooDark document images, as defined in the ImageAnalysisLightingStatus enum. A value of true means images with inadequate lighting conditions will be excluded from further processing to prevent images with inadequate lighting from being used - If inadequate light conditions are detected ProcessingStatus will be ImagePreprocessingFailed and lighting status will be reported in the ProcessResult.

Link copied to clipboard

The level of allowed detected tilt of the document in the image. Defines the severity of allowed detected tilt of the document in the image, as defined in DetectionLevel. Values range from Off (detection NotAvailable) to higher levels of allowed tilt. Low – less sensitive to tilt. High – highly sensitive to tilt.

Functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)