Documentation
Table of contents

LocalizationModes

Determines how to localize barcodes. It consists of one or more modes, each mode representing a different localization process.

Example

"LocalizationModes" :
[
    {
        "Mode" : "LM_CONNECTED_BLOCKS"
    },
    {
        "Mode" : "LM_SCAN_DIRECTLY",
        "ScanDirection" : 0,
        "ScanStride" : 0
    }
]

Parameter Summary

Parameter LocalizationModes consist of a group of localization mode objects. Each localization mode object includes a candidate mode and a series of auxiliary mode arguments. The structure of the localization mode object is shown as follow:

Mode Arguments

Mode Argument Name Mode Argument Summary
Mode
(Required)
Description
Any one in Candidate Mode List as string
Type
String
Candidate Mode List
LM_CONNECTED_BLOCKS
LM_STATISTICS
LM_LINES
LM_SCAN_DIRECTLY
LM_STATISTICS_MARKS
LM_STATISTICS_POSTAL_CODE
LM_CENTRE
LM_ONED_FAST_SCAN
LM_SKIP
Default Value
ScanStride
(Optional)
Description
Sets the stride in pixels between scans when searching for barcodes.
Type
int
Range
[0,0x7fffffff]
Default Value
0
Valid For
LM_SCAN_DIRECTLY
LM_ONED_FAST_SCAN
ScanDirection
(Optional)
Description
Sets the scan direction when searching barcode.
Type
int
Range
[0,2]
Default Value
0
Remarks
0: Both vertical and horizontal direction.
1: Vertical direction.
2: Horizontal direction.
Valid For
LM_SCAN_DIRECTLY
LM_ONED_FAST_SCAN
ConfidenceThreshold
(Optional)
Description
Sets the confidence threshold.
Type
int
Range
[0,100]
Default Value
60
Valid For
LM_ONED_FAST_SCAN
IsOneDStacked
(Optional)
Description
Sets whether the oned barcodes are stacked.
Type
int
Range
[0, 1]
Default Value
0
Valid For
LM_SCAN_DIRECTLY
ModuleSize
(Optional)
Description
Set the module size, if the module size is known.
Type
int
Range
[0, 0x7fffffff]
Default Value
0
Valid For
LM_CENTRE
LibraryFileName
(Optional)
Description
Sets the file name of the library to load dynamically.
Type
String
Range
A string value representing file name.
Default Value
""
Valid For
All candidate modes.
LibraryParameters
(Optional)
Description
The library must be in the same place with Dynamsoft Barcode Reader Library.
Type
String
Range
A string value representing parameters.
Default Value
""
Valid For
All candidate modes.

Default Settings

If the LocalizationModes is not configured in your template file, the following settings will be used as the default settings.

{
    "LocalizationModes" : 
    [
        {
            "Mode" : "LM_CONNECTED_BLOCKS"
        },
        {
            "IsOneDStacked" : 0,
            "Mode" : "LM_SCAN_DIRECTLY",
            "ScanDirection" : 0,
            "ScanStride" : 0
        },
        {
            "Mode" : "LM_STATISTICS",
        },
        {
            "Mode" : "LM_LINES",
        }
    ]
}

If you specified an localization mode object with Mode Argument “Mode” only, the default values of the other mode arguments will used.

Candidate Modes Descriptions

LM_CONNECTED_BLOCKS

Localizes barcodes by searching for connected blocks. This algorithm usually gives best result and it is recommended to set ConnectedBlocks to the highest priority. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • LibraryFileName
  • LibraryParameters

LM_STATISTICS

Localizes barcodes by groups of contiguous black-white regions. This is optimized for QRCode and DataMatrix. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • LibraryFileName
  • LibraryParameters

LM_LINES

Localizes barcodes by searching for groups of lines. This is optimized for 1D and PDF417 barcodes. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • LibraryFileName
  • LibraryParameters

LM_SCAN_DIRECTLY

Localizes barcodes quickly. This mode is recommended in interactive scenario. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • ScanStride
  • ScanDirection
  • IsOneDStacked
  • LibraryFileName
  • LibraryParameters

LM_STATISTICS_MARKS

Localizes barcodes by groups of marks. This is optimized for DPM codes. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • LibraryFileName
  • LibraryParameters

LM_STATISTICS_POSTAL_CODE

Localizes barcodes by groups of connected blocks and lines.This is optimized for postal codes. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • LibraryFileName
  • LibraryParameters

LM_CENTRE

Localizes barcodes from the centre of the image. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • ModuleSize
  • LibraryFileName
  • LibraryParameters

LM_ONED_FAST_SCAN

Localizes 1D barcodes in a fast mode. This mode is designed for reading 1D barcodes in a very fast mode. This mode has the following arguments for further cuztomization.

Available Mode Arguments:

  • ScanStride
  • ScanDirection
  • ConfidenceThreshold
  • LibraryFileName
  • LibraryParameters

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest version (2.2.20)
    • Version 2.x
      • Version 2.2.10
      • Version 2.2.0
      • Version 2.0.30
      • Version 2.0.20
      • Version 2.0.10
      • Version 2.0.0
    Change +
    © 2003–2024 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support