FurtherModes
Attributes
Attribute | Type |
---|---|
colourConversionModes | number | EnumColourConversionMode |
grayscaleTransformationModes | number | EnumGrayscaleTransformationMode |
regionPredetectionModes | number | EnumRegionPredetectionMode |
imagePreprocessingModes | number | EnumImagePreprocessingMode |
textureDetectionModes | number | EnumTextureDetectionMode |
dpmCodeReadingModes | number | EnumDPMCodeReadingMode |
deformationResistingModes | number | EnumDeformationResistingMode |
barcodeComplementModes | number | EnumBarcodeComplementMode |
barcodeColourModes | number | EnumBarcodeColourMode |
colourConversionModes
Sets the modes and their correspondent priorities when the SDK is required to convert a colour image to a grayscale one.
Value Range Please see the EnumColourConversionMode items.
Default Value [CICM_GENERAL,CICM_SKIP,CICM_SKIP,CICM_SKIP,CICM_SKIP,CICM_SKIP,CICM_SKIP,CICM_SKIP]
grayscaleTransformationModes
This parameter should be mainly used when trying to read light on dark barcodes. By default, the SDK is configured to read dark on light barcodes.
Value Range An array of EnumGrayscaleTransformationMode items.
Default Value [GTM_ORIGINAL,GTM_SKIP,GTM_SKIP,GTM_SKIP,GTM_SKIP,GTM_SKIP,GTM_SKIP,GTM_SKIP]
Remarks If you are primarily scanning dark on light barcodes, it is best to set the highest priority item in the array to GTM_INVERTED
.
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.grayscaleTransformationModes[0] = Dynamsoft.DBR.EnumGrayscaleTransformationMode.GTM_INVERTED;
await reader.updateRuntimeSettings(runtimeSettings);
regionPredetectionModes
This parameters helps speed up the recognition process by detecting regions of interest automatically. Pre-detection is based on the colour/grayscale distribution of each area, and then choosing areas of interest based on the priority of the region predetction modes.
Value Range Array of EnumRegionPredetectionMode items.
Default Value [RPM_GENERAL,RPM_SKIP,RPM_SKIP,RPM_SKIP,RPM_SKIP,RPM_SKIP,RPM_SKIP,RPM_SKIP]
Remarks If the image is large, and the barcode is very small relative to the whole image, then it is recommended to enable region predetction to speed up the localization process and recognition accuracy.
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.regionPredetectionModes[0] = Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL_RGB_CONTRAST;
runtimeSettings.furtherModes.regionPredetectionModes[1] = Dynamsoft.DBR.EnumRegionPredetectionMode.RPM_GENERAL;
await reader.updateRuntimeSettings(runtimeSettings);
imagePreprocessingModes
This parameter helps enhance or keep the features of barcode zones by processing colour or grayscale images, in turn improving the localization process.
Value Range Array of EnumImagePreprocessingMode items.
Default Value [IPM_GENERAL,IPM_SKIP,IPM_SKIP,IPM_SKIP,IPM_SKIP,IPM_SKIP,IPM_SKIP,IPM_SKIP]
Remarks In order for barcodes to be localized, the barcode must have clear barcode zone features that the algorithm uses to find the barcode and in turn recognize it. By enhancing some of the available zone features, the process of finding the barcode can also potentially become more effective.
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.imagePreprocessingModes[0] = Dynamsoft.DBR.EnumImagePreprocessingMode.IPM_GRAY_SMOOTH;
runtimeSettings.furtherModes.imagePreprocessingModes[1] = Dynamsoft.DBR.EnumImagePreprocessingMode.IPM_SHARPEN_SMOOTH;
await reader.updateRuntimeSettings(runtimeSettings);
textureDetectionModes
When scanning 1D barcodes, this parameter helps reduce the time cost and error probability caused by textures that can resemble 1D barcodes.
Value Range Array of EnumTextureDetectionMode items.
Default Value [TDM_GENERAL_WIDTH_CONCENTRATION,TDM_SKIP,TDM_SKIP,TDM_SKIP,TDM_SKIP,TDM_SKIP,TDM_SKIP,TDM_SKIP]
Remarks Mainly applicable when scanning 1D barcodes.
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.textureDetectionModes[0] = Dynamsoft.DBR.EnumTextureDetectionMode.TDM_SKIP; // to disable this parameter completely
await reader.updateRuntimeSettings(runtimeSettings);
dpmCodeReadingModes
This parameter should only be enabled when working with DPM codes. By default, DPM reading is disabled.
Value Range Array of EnumDPMCodeReadingMode items
Default Value [DPMCRM_SKIP,DPMCRM_SKIP,DPMCRM_SKIP,DPMCRM_SKIP,DPMCRM_SKIP,DPMCRM_SKIP,DPMCRM_SKIP,DPMCRM_SKIP]
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.dpmCodeReadingModes[0] = Dynamsoft.DBR.EnumDPMCodeReadingMode.DPMCRM_GENERAL; // to enable DPM code reading set the highest priority item to General
await reader.updateRuntimeSettings(runtimeSettings);
deformationResistingModes
This parameter should be used when handling distorted or deformed barcodes. Currently, there is only one general mode that deal with the deformation resistance, so if you are looking to enable this feature, then please refer to the code snippet.
Value Range Array of EnumDeformationResistingMode items
Default Value [DRM_SKIP,DRM_SKIP,DRM_SKIP,DRM_SKIP,DRM_SKIP,DRM_SKIP,DRM_SKIP,DRM_SKIP]
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.deformationResistingModes[0] = Dynamsoft.DBR.EnumDeformationResistingMode.DRM_GENERAL; // to enable deformation resistance set the highest priority item to General
await reader.updateRuntimeSettings(runtimeSettings);
barcodeComplementModes
When dealing with a barcode that has ‘missing’ parts, this parameter controls how to complement the missing parts of said barcode.
Value Range Array of EnumBarcodeComplementMode items
Default Value [BCM_SKIP,BCM_SKIP,BCM_SKIP,BCM_SKIP,BCM_SKIP,BCM_SKIP,BCM_SKIP,BCM_SKIP]
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.barcodeComplementModes[0] = Dynamsoft.DBR.EnumBarcodeComplementMode.BCM_GENERAL; // to enable the barcode complement feature set the highest priority item to General
await reader.updateRuntimeSettings(runtimeSettings);
barcodeColourModes
Please note that this API is not yet applicable. Please use grayscaleTransformationModes instead.
In most cases, barcodes come as a dark image with a light background (e.g. black barcode on a white background). However, that is not always the case as the barcodes can come as a light image with a dark background, or some other variation.
Value Range Array of EnumBarcodeColourMode items
Default Value [BICM_DARK_ON_LIGHT,BICM_SKIP,BICM_SKIP,BICM_SKIP,BICM_SKIP,BICM_SKIP,BICM_SKIP,BICM_SKIP]
Remarks To learn about the purpose of each mode, please refer to this page.
let runtimeSettings = await reader.getRuntimeSettings();
runtimeSettings.furtherModes.barcodeColourModes[0] = Dynamsoft.DBR.EnumBarcodeColourMode.BICM_DARK_ON_LIGHT; // to support both dark-on-light and light-on-dark barcodes then the array must contain both modes.
runtimeSettings.furtherModes.barcodeColourModes[1] = Dynamsoft.DBR.EnumBarcodeColourMode.BICM_LIGHT_ON_DARK; // to support both dark-on-light and light-on-dark barcodes then the array must contain both modes.
await reader.updateRuntimeSettings(runtimeSettings);