Documentation
Table of contents

ScaleUpModes

Parameter ScaleUpModes is for controlling the scale-up process when targets in the image are too small.

Example

{
    "ScaleUpModes": 
    [
        {
            "Mode": "SUM_LINEAR_INTERPOLATION", 
            "ModuleSizeThreshold": 4,
            "TargetModuleSize": 8
        },
        {
            "Mode": "SUM_NEAREST_NEIGHBOUR_INTERPOLATION", 
            "ModuleSizeThreshold": 4,
            "TargetModuleSize": 6
        },
        {
            "Mode": "SUM_LINEAR_INTERPOLATION",
            "LetterHeightThreshold": 10,
            "TargetLetterHeight": 50
        }
    ]
}

Parameter Summary

Parameter ScaleUpModes consist of a group of scale up mode objects. Each scale up mode object includes a candidate mode and a series of mode arguments. The mode arguments of the scale up 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
SUM_LINEAR_INTERPOLATION
SUM_NEAREST_NEIGHBOUR_INTERPOLATION
SUM_AUTO
SUM_SKIP
Default Value

SUM_AUTO
AcuteAngleWithXThreshold
(Optional)
Description
Sets the acute angle threshold for barcode scale-up.
-1: means automatically set by the library.
If the module size of the barcode is smaller than the ModuleSizeThreshold and the acute angle with X of the barcode is larger than the AcuteAngleWithXThreshold, the barcode will be enlarged by a scale factor of N (the value of N is a power of 2) till N * modulesize >= TargetModuleSize.
Type
int
Range
[-1, 90]
Default Value
-1
Valid For

SUM_LINEAR_INTERPOLATION
SUM_NEAREST_NEIGHBOUR_INTERPOLATION
ModuleSizeThreshold
(Optional)
Description
Sets the module size threshold for barcode scale-up.
0: means automatically set by the library.
If the module size of the barcode is smaller than the ModuleSizeThreshold and the acute angle with X of the barcode is larger than the AcuteAngleWithXThreshold, the barcode will be enlarged by a scale factor of N (the value of N is a power of 2) till N * modulesize >= TargetModuleSize.
Type
int
Range
[1, 0x7fffffff]
Default Value
0
Valid For

SUM_LINEAR_INTERPOLATION
SUM_NEAREST_NEIGHBOUR_INTERPOLATION
TargetModuleSize
(Optional)
Description
Sets the module size threshold for barcode scale-up.
0: means automatically set by the library.
If the module size of the barcode is smaller than the ModuleSizeThreshold and the acute angle with X of the barcode is larger than the AcuteAngleWithXThreshold, the barcode will be enlarged by a scale factor of N (the value of N is a power of 2) till N * modulesize >= TargetModuleSize.
Type
int
Range
[0, 0x7fffffff]
Default Value
0
Valid For

SUM_LINEAR_INTERPOLATION
SUM_NEAREST_NEIGHBOUR_INTERPOLATION
LetterHeightThreshold
(Optional)
Description
Sets the letter height threshold for character scale-up.
0 : means automatically set by the library. If the average letter height of a text line is smaller than the LetterHeightThreshold, the image will be enlarged to N times (N=2,4,8…) till N * LetterHeight >= TargetLetterHeight.
Type
int
Range
[0, 0x7fffffff]
Default Value
0
Valid For

SUM_LINEAR_INTERPOLATION
SUM_NEAREST_NEIGHBOUR_INTERPOLATION
TargetLetterHeight
(Optional)
Description
Sets the target letter height for character scale-up.
0 : means automatically set by the library.
Type
int
Range
[0, 0x7fffffff]
Default Value
0
Valid For

SUM_LINEAR_INTERPOLATION
SUM_NEAREST_NEIGHBOUR_INTERPOLATION
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 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 modes.

Default Setting

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

{
    "ScaleUpModes" : 
    [
        {
            "AcuteAngleWithXThreshold" : -1,
            "LetterHeightThreshold" : 0,
            "Mode" : "SUM_AUTO",
            "ModuleSizeThreshold" : 0,
            "TargetLetterHeight" : 0,
            "TargetModuleSize" : 0
        }
    ]
}

Candidate Modes Introduction

SUM_LINEAR_INTERPOLATION

Scales up using the linear interpolation method. This mode has the following arguments for further customizing:

  • AcuteAngleWithXThreshold
  • ModuleSizeThreshold
  • TargetModuleSize
  • LetterHeightThreshold
  • TargetLetterHeight
  • LibraryFileName
  • LibraryParameters

SUM_NEAREST_NEIGHBOUR_INTERPOLATION

Scales up using the nearest neighbour method. This mode has the following arguments for further customizing:

  • AcuteAngleWithXThreshold
  • ModuleSizeThreshold
  • TargetModuleSize
  • LetterHeightThreshold
  • TargetLetterHeight
  • LibraryFileName
  • LibraryParameters

SUM_AUTO

Lets the library choose a mode automatically.

This page is compatible for:

Is this page helpful?

YesYes NoNo

In this article:

latest version

    Change +