Configuration options

The configuration options are provided when the engine is initialized and they are case-sensitive.

Sample config on ARM devices:

{
            "debug_level": "info",
            "debug_write_input_image_enabled": false,
            "debug_internal_data_path": ".",

            "num_threads": -1,
            "gpgpu_enabled": true,
            "gpgpu_workload_balancing_enabled": true,
            "backpropagation_enabled": true,
            "vertical_check_enabled": true,

            "segmenter_accuracy": "high",
            "interpolation": "bilinear",
            "min_num_lines": 2,
            "roi": [0, 0, 0, 0],
            "min_score": 0.0
}

debug_level

Defines the debug level to output on the console. You should use “verbose” for diagnostic, “info” in development stage and “warn” in production.
Default: “info”

type

string

pattern

“verbose” | “info” | “warn” | “error” | “fatal”

debug_write_input_image_enabled

Whether to write the transformed input image to the disk. This could be useful for debugging.
Default: false

type

bool

pattern

true | false

debug_internal_data_path

Path to the folder where to write the transformed input image. Used only if debug_write_input_image_enabled is true.
Default: “”

type

string

pattern

folder path

license_token_file

Path to the file containing the license token. First you need to generate a Runtime Key using requestRuntimeLicenseKey() function then activate the key to get a token. You should use license_token_file or license_token_data but not both.

type

string

pattern

file path

license_token_data

Base64 string representing the license token. First you need to generate a Runtime Key using requestRuntimeLicenseKey() function then activate the key to get a token. You should use license_token_file or license_token_data but not both.

type

string

pattern

base64

num_threads

Defines the maximum number of threads to use. You should not change this value unless you know what you’re doing. Set to -1 to let the SDK choose the right value. The right value the SDK will choose will likely be equal to the number of virtual core. For example, on an octa-core device the maximum number of threads will be 8.
Default: -1

type

int

pattern

[-inf, +inf]

gpgpu_enabled

Whether to enable GPGPU computing. This will enable or disable GPGPU computing on the computer vision and deep learning libraries. On ARM devices this flag will be ignored when fixed-point (integer) math implementation exist for a well-defined function. For example, this function will be disabled for the bilinear scaling as we have a fixed-point SIMD accelerated implementation. Same for many deep learning parts as we’re using QINT8 quantized inference.
Default: true

type

bool

pattern

true | false

gpgpu_workload_balancing_enabled

A device contains a CPU and a GPU. Both can be used for math operations. This option allows using both units. On some devices the CPU is faster and on other it’s slower. When the application starts, the work (math operations to perform) is equally divided: 50% for the CPU and 50% for the GPU. Our code contains a profiler to determine which unit is faster and how fast (percentage) it is. The profiler will change how the work is divided based on the time each unit takes to complete. This is why this configuration entry is named “workload balancing”.
Default: false for x86 and true for ARM

type

bool

pattern

true | false

assets_folder

Path to the folder containing the configuration files and deep learning models. Default value is the current folder.
The SDK will look for the models in $(assets_folder)/models folder.
Default: .
Available since: 2.1.0

type

string

pattern

folder path

backpropagation_enabled

Whether to enable backpropagation to detect the MRZ lines. Check the relevant section for more information about backpropagation.
Available since: 2.5.2
Default: true on x86 CPUs and false on ARM CPUs

type

boolean

pattern

true | false

vertical_check_enabled

Whether to enable vertical check to detect +/-90deg rotated images. We recommend not enabling this features as it adds significant latency.
Available since: 2.8.1
Default: false

type

boolean

pattern

true | false

ielcd_enabled

Whether to enable Image Enhancement for Low Contrast Document (IELCD) feature.
Available since: 2.6.0
Default: true on x86 CPUs and false on ARM CPUs

type

boolean

pattern

true | false

roi

Defines the Region Of Interest (ROI) for the detector. Any pixels outside region of interest will be ignored by the detector. Defining an WxH region of interest instead of resizing the image at WxH is very important as you’ll keep the same quality when you define a ROI while you’ll lose in quality when using the later.
Default: [0.f, 0.f, 0.f, 0.f]

type

float[4]

pattern

[left, right, top, bottom]

segmenter_accuracy

Before calling the classifier to determine whether a zone contains a MRZ line we need to segment the text using multi-layer segmenter followed by clustering. The multi-layer segmenter uses hysteresis for the voting process using a [min, max] double thresholding values. This configuration entry defines how low the thresholding values should be. Lower the values are, higher the number of fragments will be and higher the recall will be. High number of fragments means more data to process which means more CPU usage and higher processing time.
Default: high

type

string

pattern

“veryhigh” | “high” | “medium” | “low” | “verylow”

interpolation

Defines the interpolation method to use when pixels are scaled, deskewed or deslanted. bicubic offers the best quality but is slow as there is no SIMD or GPU acceleration yet. bilinear and nearest interpolations are multithreaded and SIMD accelerated. For most scenarios bilinear interpolation is good enough to provide high accuracy/precision results while the code still runs very fast.
Default: bilinear

type

string

pattern

“nearest” | “bilinear” | “bicubic”

min_num_lines

Defines the minimum number of MRZ lines needed to form a valid zone. For example, this value must be 2 for passports (TD3 format) and visas (MRVA and MRVB formats).
Default: 2

type

int

pattern

[1, inf]

min_score

Defines a threshold for the recognition score/confidence. Any recognition with a score below that threshold will be ignored/removed. This value could be used to filter the false-positives and improve the precision. Low value will lead to high recall and low precision while a high value means the opposite.
Default: 0.0f
0.f being poor confidence and 1.f excellent confidence.

type

int

pattern

[0.f, 1.f]