Class DocumentScannerConfiguration

Hierarchy

  • ScannerConfiguration
    • DocumentScannerConfiguration

Constructors

Properties

acceptedAngleScore?: number

The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Default is 75.0.

acceptedBrightnessThreshold?: number

An average brightness is computed as follows: It is the average of the Value channel in the HSV color space of:

  • the whole image, if no document was detected
  • the document crop, if a document was detected It ranges from 0 to 255. If this computed value is below the acceptanceBrightnessThreshold, the document is accepted.
acceptedSizeScore?: number

The minimum document width or height in percent (0-100) of the screen size to accept a detected document. Default is 80.0.

autoCaptureDelay?: number

Delay in milliseconds before the auto-capture is triggered after 'onDocumentDetected' has been called. This delay is used to prevent too many documents being captured in a row. In essence, autoCaptureSensitivity controls the speed of autocapture during the detection phase, while autoCaptureDelay controls the speed of autocapture after the detection phase. Default is 1000ms.

autoCaptureEnabled?: boolean

If auto-capture is enabled and when a document is detected, it will be automatically captured when conditions are good and the auto-snapping time-out elapses.

autoCaptureSensitivity?: number

Controls the auto-capture speed. Sensitivity must be within the 0..1 range. A value of 1.0 triggers automatic capturing immediately, a value of 0.0 delays the automatic by 3 seconds. The default value is 0.66 (2 seconds)

backgroundColor?: string
container?: HTMLElement

The container HTML element of Scanbot Web SDK camera. Required when 'containerId' property is left undefined when calling any ScanbotSDK createScanner function. If both are provided, 'container' property takes precedence.

containerId?: string

The container HTML element id of Scanbot Web SDK camera. Required when 'container' property is left undefined when calling any ScanbotSDK createScanner function If both are provided, 'container' property takes precedence.

ignoreBadAspectRatio?: boolean

Determines whether to ignore the OK_BUT_BAD_ASPECT_RATIO detection status. By default BadAspectRatio is not ignored.

mirrored?: boolean
onCaptureButtonClick?: ((e) => void)

Type declaration

    • (e): void
    • By default, capture button invokes 'onDocumentDetected' callback, if you want custom behavior, you can optionally override this button

      Parameters

      • e: any

      Returns void

onDocumentDetected?: ((e) => void)

Type declaration

    • (e): void
    • Document detected callback. Continuous callback, stopped only when detection is stopped or camera widget is disposed. Result contains the following properties: detectionStatus: "OK", success: true, cropped: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...", original: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...", polygon: Array(4)}

      Parameters

      • e: any

      Returns void

onError?: ((e) => void)

Type declaration

    • (e): void
    • Error callback of the SDK.

      Parameters

      • e: any

      Returns void

preferredCamera?: string
spinnerColor?: string
useImageCaptureAPI?: boolean

Attempts to take a single exposure using the video capture device, resulting in a high resolution image and potentially greatly improved detection quality. Relies on the experimental ImageCapture API that: https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture. Use with caution. At the time of writing this, reliably only works on Android devices with Google Chrome. If enabled, this only affects extraction after the document outline has been identified. This may also trigger your device's default "snap" animation, making scanbotSDK.utils.flash(); irrelevant Defaults to false.

videoConstraints?: any

ScanbotCameraView video constraints

DEFAULT_ACCEPTED_ANGLE_SCORE: number
DEFAULT_ACCEPTED_BRIGHTNESS_SCORE: number
DEFAULT_ACCEPTED_SIZE_SCORE: number
DEFAULT_VIDEO_RESOLUTION_4K: {
    height: number;
    width: number;
}

Type declaration

  • height: number
  • width: number
DEFAULT_VIDEO_RESOLUTION_HD: {
    height: number;
    width: number;
}

Type declaration

  • height: number
  • width: number

Methods

  • Parameters

    • source: any
    • destination: {
          [key: string]: any;
      }
      • [key: string]: any
    • Optional ignore: string[]

    Returns void

  • Parameters

    • source: any
    • destination: {
          [key: string]: any;
      }
      • [key: string]: any

    Returns void

Generated using TypeDoc