Settings Control
Scan Settings
API Name | Description |
---|---|
getScanSettings() | Returns the current scan settings. |
updateScanSettings() | Changes scan settings with the object passed in. |
Runtime Settings
API Name | Description |
---|---|
updateRuntimeSettingsFromString() | Updates runtime settings with a template represented by a JSON string. |
outputRuntimeSettingsToString() | Output the current runtime settings to a JSON string. |
updateReferenceRegionFromBarcodeResults() | Updates reference region which is defined with source type DLR_LST_BARCODE . |
getScanSettings
Returns the current scan settings.
getScanSettings(): Promise<ScanSettings>
Return value
A promise resolving to a ScanSettings
object.
Code Snippet
let scanSettings = await recognizer.getScanSettings();
scanSettings.intervalTime = 50;
scanSettings.duplicateForgetTime = 1000;
await recognizer.updateScanSettings(scanSettings);
See also
updateScanSettings
Changes scan settings with the object passed in.
updateScanSettings(settings: ScanSettings): Promise<void>
Parameters
settings
: specifies the new scan settings.
Return value
A promise that resolves when the operation succeeds.
Code Snippet
let scanSettings = await recognizer.getScanSettings();
scanSettings.intervalTime = 50;
scanSettings.duplicateForgetTime = 1000;
await recognizer.updateScanSettings(scanSettings);
See also
updateRuntimeSettingsFromString
Updates runtime settings with a template represented by a JSON string.
updateRuntimeSettingsFromString(runtimeSettings: string): Promise<void>
Parameters
runtimeSettings
: a JSON string that specifies the runtime settings or one of the built-in runtimeSettings
templates. The following are the built-in templates:
Name | Description |
---|---|
number |
For pure number recognition. |
numberLetter |
For number and English letter recognition. |
numberUpperCase |
For number and uppercase English letter recognition. |
letter |
For pure English letter recognition. |
passportMRZ |
For recognition of the machine-readable zones on passports. |
visaMRZ |
For recognition of the machine-readable zones on visas. |
MRZ |
For recognition of the machine-readable zones on passports, visas and IDCards. |
VIN |
For VIN (vehicle identification number) recognition. |
VIN_NA |
For North American VIN (vehicle identification number) recognition. |
When recognizing from video input, add the prefix “video-“ for a slightly different template optimized for continuous frame recognition. For example, use video-MRZ
to read the MRZ with a camera.
Return value
A promise that resolves when the operation succeeds.
Code Snippet
/* Update settings using one of the preset templates */
await recognizer.updateRuntimeSettingsFromString('VIN');
outputRuntimeSettingsToString
Output the current runtime settings to a JSON string.
outputRuntimeSettingsToString(): Promise<string>;
Return value
A promise resolving to a JSON string that represents the runtime settings.
Code Snippet
let settings = await recognizer.outputRuntimeSettingsToString();
console.log(settings);
updateReferenceRegionFromBarcodeResults
Updates reference region which is defined with source type DLR_LST_BARCODE
.
updateReferenceRegionFromBarcodeResults(barcodeResults: BarcodeResultArray): Promise<void>
Parameters
barcodeResults
: specifies the barcode results used to localize reference region.
Return value
A promise that resolves when the operation succeeds.