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.

LabelRecognitionParameter Object

Parameter Name Description
LabelRecognitionParameter.Name The name of the LabelRecognitionParameter object.
LabelRecognitionParameter.BinarizationModes Sets the mode and priority for binarization.
LabelRecognitionParameter.CharacterModelName Sets the name of a white list of recognizable characters.
LabelRecognitionParameter.GrayscaleTransformationModes Sets the mode and priority for the grayscale image conversion.
LabelRecognitionParameter.LetterHeightRange Sets the range of letter height (in pixel or a percentage value relative to the height of the text area).
LabelRecognitionParameter.LinesCount Sets the text lines count of the text area.
LabelRecognitionParameter.LineStringRegExPattern Specifies the regular expression pattern of each line string text in current image to recognize.
LabelRecognitionParameter.MaxThreadCount Sets the maximum number of threads the algorithm will use to recognize text.
LabelRecognitionParameter.ReferenceRegionNameArray The name array of the ReferenceRegion object(s).
LabelRecognitionParameter.RegionPredetectionModes Sets the region pre-detection mode for searching target regions.
LabelRecognitionParameter.TextRegExPattern Specifies the regular expression pattern of the text to recognize.

RegionPredetectionModes

Remarks

If the image is large and the target region on the image is 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 DLRRegionPredetectionMode 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
DLRRegionPredetectionMode array “DLR_RPM_SKIP”
“DLR_RPM_AUTO”
“DLR_RPM_GENERAL”
“DLR_RPM_GENERAL_RGB_CONTRAST”
“DLR_RPM_GENERAL_GRAY_CONTRAST”
“DLR_RPM_GENERAL_HSV_CONTRAST”
[“DLR_RPM_GENERAL”, “DLR_RPM_SKIP”, “DLR_RPM_SKIP”, “DLR_RPM_SKIP”, “DLR_RPM_SKIP”, “DLR_RPM_SKIP”, “DLR_RPM_SKIP”, “DLR_RPM_SKIP”]

Mode Arguments

AspectRatioRange

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

Value Type Value Range Default Value Valid Modes
string A string value representing aspect ratio range. ”” “DLR_RPM_GENERAL_HSV_CONTRAST”

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 Valid Modes
string A string value representing one or more colour sets. ”” “DLR_RPM_GENERAL_HSV_CONTRAST”

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 Valid Modes
string A string value representing height range. ”” “DLR_RPM_GENERAL_HSV_CONTRAST”

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 Valid Modes
int [16384, 0x7fffffff] 262144 “DLR_RPM_GENERAL_GRAY_CONTRAST”
“DLR_RPM_GENERAL_HSV_CONTRAST”
“DLR_RPM_GENERAL_RGB_CONTRAST”

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 Valid Modes
int [0, 1] 0 “DLR_RPM_GENERAL_HSV_CONTRAST”

Remarks
0: disable.
1: enable.

Sensitivity

Sets the sensitivity used for region predetection algorithm.

Value Type Value Range Default Value Valid Modes
int [1, 9] 1 “DLR_RPM_GENERAL_GRAY_CONTRAST”
“DLR_RPM_GENERAL_HSV_CONTRAST”
“DLR_RPM_GENERAL_RGB_CONTRAST”

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 Valid Modes
int [1, 32] 5 “DLR_RPM_GENERAL_GRAY_CONTRAST”
“DLR_RPM_GENERAL_HSV_CONTRAST”
“DLR_RPM_GENERAL_RGB_CONTRAST”

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 Valid Modes
string A string value representing width range. ”” “DLR_RPM_GENERAL_HSV_CONTRAST”

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]
LibraryFileName

Sets the file name of the library to load dynamically.

Value Type Value Range Default Value Valid Modes
string A string value representing file name. ”” All DLRRegionPredetectionMode items except DLR_RPM_SKIP and DLR_RPM_AUTO

Remarks

  • The library must be in the same place with Dynamsoft Label Recognition Library.
LibraryParameters

Sets the parameters passed to the library to load dynamically.

Value Type Value Range Default Value Valid Modes
string A string value representing parameters. ”” All DLRRegionPredetectionMode items except DLR_RPM_SKIP and DLR_RPM_AUTO

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
LabelRecognitionParameter RegionPredetectionModes JSON Object Array

Json Parameter Example

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

 

As DLRRuntimeSettings Member

regionPredetectionModes is a DLRRegionPredetectionMode array defines in DLRRuntimeSettings. 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
DLRRuntimeSettings regionPredetectionModes DLRRegionPredetectionMode[8]

See Also

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

In this article:

version 1.0

  • 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 +