Documentation
Table of contents

Thanks for downloading Dynamsoft Label Recognizer Package!

Your download will start shortly. If your download does not begin, click here to retry.

LabelRecognizerParameter Object

RegionPredetectionModes

Remarks
If the image is large and the target regions on the image are very small, it is recommended to enable region predetection to speed up the localization process and recognition accuracy.

Mode Properties

RegionPredetectionModes is a parameter for setting the mode for region pre-detection. It consisits of one or more RegionPredetectionMode items and each item has its own arguments. The array index represents the priority of the item. The smaller index is, the higher priority is.

Value Type Value Range Default Value
RegionPredetectionMode array “RPM_SKIP”
“RPM_AUTO”
“RPM_GENERAL”
“RPM_GENERAL_RGB_CONTRAST”
“RPM_GENERAL_GRAY_CONTRAST”
“RPM_GENERAL_HSV_CONTRAST”
[“RPM_GENERAL”, “RPM_SKIP”, “RPM_SKIP”, “RPM_SKIP”, “RPM_SKIP”, “RPM_SKIP”, “RPM_SKIP”, “RPM_SKIP”]

Mode Arguments

AspectRatioRange

Sets the aspect ratio range of the bounding rectangle of the predetected region.

Value Type Value Range Default Value
string A string value representing aspect ratio range. ””

Remarks

  • The aspect ratio range need to be defined as [MinAspectRatio, MaxAspectRatio]. There will be no limitation without manual setting.
  • Aspect ratio equals to height/width*100. MinAspectRatio and MaxAspectRatio are used for limiting the aspect ratio range of the predetected region.
  • Value range of MinAspectRatio, MaxAspectRatio: [1,10000]
ForeAndBackgroundColours

Specifies a set (or multiple sets) of the foreground and background colours used for region predetection algorithm.

Value Type Value Range Default Value
string A string value representing one or more colour sets. ””

Remarks

  • Each set of the foreground and background colours need to be defined as [ForegroundColour, BackgroundColour, Tolerance]. If you want to define multiple sets, you can use a “”;”” to separate them. This argument is mandatory. If there is no manual setting, no region can be detected.
  • ForegroundColourand BackgroundColour are the Hue values in the HSV colour space for defining the foreground and background colours of the regions you want to predetect. The value -1 means black, gray, white.
  • Tolerance is the allowable deviation of the Hue value defined by ForegroundColour.
  • Value range of ForegroundColour, BackgroundColour: [-1,360]
  • Value range of Tolerance: [0, 360]
HeightRange

Sets the height range of the bounding rectangle of the predetected region.

Value Type Value Range Default Value
string A string value representing height range. ””

Remarks

  • The height range need to be defined as [MinHeight, MaxHeight]. There will be no limitation without manual setting.
  • Value range of MinHeight, MaxHeight: [1,0x7fffffff]
MinImageDimension

Sets the minimum image dimension (in pixels) to pre-detect target regions.

Value Type Value Range Default Value
int [16384, 0x7fffffff] 262144

Remarks
If the image dimension is larger than the given value, the library will enable the feature of pre-detecting target regions. Otherwise, it will skip this step when searching for target regions.

FindAccurateBoundary

Sets whether to enable finding accurate boundary.

Value Type Value Range Default Value
int [0, 1] 0

Remarks
0: disable.
1: enable.

Sensitivity

Sets the sensitivity used for region predetection algorithm.

Value Type Value Range Default Value
int [1, 9] 1

Remarks
A larger value means the library will take more effort to detect regions.

SpatialIndexBlockSize

Sets the spatial index block size used for region predetection algorithm.

Value Type Value Range Default Value
int [1, 32] 5

Remarks
The block size used for region predetection would be 2 to the power of N. The allowed values of SpatialIndexBlockSize is the power number (N=1,2,3…).

WidthRange

Sets the width range of the bounding rectangle of the predetected region.

Value Type Value Range Default Value
string A string value representing width range. ””

Remarks

  • The width range need to be defined as [MinWidth, MaxWidth]. There will be no limitation without manual setting.
  • Value range of MinWidth, MaxWidth: [1,0x7fffffff]

Setting Methods

As JSON Parameter

RegionPredetectionModes as a JSON parameter is a JSON Object array. Each JSON Object has several keys for setting the mode and the value of arguments. The array index decides the priority the region pre-detection mode for searching target regions. Default values will be used if there is no manual setting.

Json Object Json Parameter Name Value Type
LabelRecognizerParameter RegionPredetectionModes JSON Object Array

Json Parameter Example

{
    "RegionPredetectionModes": [
        {
            "Mode": "RPM_GENERAL_GRAY_CONTRAST",
            "Sensitivity": 5,
            "MinImageDimension":262144
        }
    ]
}

As DLR_RuntimeSettings Member

regionPredetectionModes is a RegionPredetectionMode array defines in DLR_RuntimeSettings. It is used for setting the modes and the priority for region pre-detection. Default value will be used if there is no manual setting.

Struct Struct Member Name Value Type
DLR_RuntimeSettings->furtherModes regionPredetectionModes RegionPredetectionMode[8]

See Also

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version(3.2.20)
  • Version 3.x
    • Version 3.2.10
    • Version 3.2.0
    • Version 3.0.30
    • Version 3.0.20
    • Version 3.0.10
    • Version 3.0.0
  • Version 2.x
    • Version 2.2.20
    • Version 2.2.11
    • Version 2.2.10
    • Version 2.2.0
    • Version 2.0.0
  • Version 1.x
    • Version 1.2.1
    • Version 1.2
    • Version 1.0
Change +