Table of contents

Need better scanning performance?

Get a FREE customized reading template.

BarcodeScaleModes

Parameter BarcodeScaleModes defines the scaling mode applied during barcode recognition.

JSON Structure

Location in template:

BarcodeReaderTaskSettingOptions[i]
    ├── SectionArray[j]
    │   └── StageArray[k] (Stage object)
    │       └── BarcodeScaleModes

Parent object: ScaleBarcodeImageStage object

Example:

{
    "BarcodeScaleModes": [
        {
            "Mode": "BSM_AUTO",
            "ModuleSizeThreshold": 0,
            "TargetModuleSize": 0,
            "AcuteAngleWithXThreshold": -1
        }
    ]
}
  • This snippet shows only the BarcodeScaleModes parameter.
  • To use it, embed this parameter within a Stage object at the SST_SCALE_BARCODE_IMAGE stage.
  • For the complete JSON structure, see:

Parameter Details

Parameter BarcodeScaleModes consists of a group of barcode scale mode objects. Each barcode scale mode object includes a candidate mode and a series of auxiliary mode arguments.

Mode Arguments

The mode arguments of the barcode scale mode object are shown as follows:

Mode Arguments

Mode Argument Name Mode Argument Summary
Mode
(Required)
Description
Any one in Candidate Mode List as string
Type
String
Candidate Mode List
BSM_LINEAR_INTERPOLATION
BSM_AUTO
AcuteAngleWithXThreshold
(Optional)
Description
Sets the acute angle threshold for barcode image scale.
-1: means automatically set by the library.
The barcode image scaling operation can be performed only if the acute angle between the barcode and the X-axis is greater than the value of AcuteAngleWithXThreshold.
Type
int
Range
[-1, 90]
Default Value
-1
ModuleSizeThreshold
(Optional)
Description
Sets the module size threshold for barcode image scale.
0: means automatically set by the library.
The scaling logic is as follows:
1. If ModuleSizeThreshold < TargetModuleSize, the scale-up logic is applied. If the module size of the barcode is smaller than the ModuleSizeThreshold, the barcode image will be enlarged by a scale factor of N (the value of N is a power of 2) till N * modulesize >= TargetModuleSize.
2. If ModuleSizeThreshold > TargetModuleSize, the scale-down logic is applied. If the module size of the barcode is larger than the ModuleSizeThreshold, the barcode image will be shrinked by a scale factor of N (the value of N is a power of 2) till N * modulesize <= TargetModuleSize.
If ModuleSizeThreshold = TargetModuleSize, the scaling operation is ignored.
Type
int
Range
[0, 0x7fffffff]
Default Value
0
TargetModuleSize
(Optional)
Description
Sets the module size threshold for barcode image scale.
0: means automatically set by the library.
The scaling logic is as follows:
1. If ModuleSizeThreshold < TargetModuleSize, the scale-up logic is applied. If the module size of the barcode is smaller than the ModuleSizeThreshold, the barcode image will be enlarged by a scale factor of N (the value of N is a power of 2) till N * modulesize >= TargetModuleSize.
2. If ModuleSizeThreshold > TargetModuleSize, the scale-down logic is applied. If the module size of the barcode is larger than the ModuleSizeThreshold, the barcode image will be shrinked by a scale factor of N (the value of N is a power of 2) till N * modulesize <= TargetModuleSize.
If ModuleSizeThreshold = TargetModuleSize, the scaling operation is ignored.
Type
int
Range
[0, 0x7fffffff]
Default Value
0

Default Setting

{
    "BarcodeScaleModes": [
        {
            "Mode": "BSM_AUTO",
            "ModuleSizeThreshold": 0,
            "TargetModuleSize": 0,
            "AcuteAngleWithXThreshold": -1
        }
    ]
}

Candidate Mode Introductions

BSM_AUTO

Lets the library choose a mode automatically. This mode has the following arguments for further customization:

Available Mode Arguments:

  • AcuteAngleWithXThreshold
  • ModuleSizeThreshold
  • TargetModuleSize

BSM_LINEAR_INTERPOLATION

Scales image using the linear interpolation method. This mode has the following arguments for further customization:

Available Mode Arguments:

  • AcuteAngleWithXThreshold
  • ModuleSizeThreshold
  • TargetModuleSize

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article: