Resource Base
Table of contents

Thanks for downloading Dynamsoft Barcode Reader Package!

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

ImageParameter Object | RegionPredetectionModes

RegionPredetectionModes

Remarks
If the image is large and the barcode 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 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
string array or 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”]

See Also :
RegionPredetectionMode Enumeration

Mode Arguments

MinImageDimension

Sets the minimum image dimension (in pixels) to pre-detect barcode 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 barcode regions. Otherwise, it will skip this step when searching for barcodes.

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.

RelativeBarcodeRegions

Sets the barcode regions relative to the predetected region.

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

Remarks

  • Each region need to be defined as [Left, Top, Right, Bottom, Index]. If you want to define multiple regions, you can use a “”;”” to separate them. If there is no region defined, the library will consider the predetected regions as barcode regions.
  • Left, Top, Right, Bottom are four percentage values relative to top-left corner of the predetected region.
  • Index means the index of a specific colour set in ForeAndBackgroundColours which the current region is applied to. If the value of index is set to -1, the current region will be applied to all colour sets in ForeAndBackgroundColours.
  • Value range of Left, Top, Right, Bottom: [-10000,10000]
  • Value range of Index: [-1, 0x7fffffff]
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]
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]
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]
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]
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…).

LibraryFileName

Sets the file name of the library to load dynamically.

Value Type Value Range Default Value Valid For
string A string value representing file name. ”” All RegionPredetectionMode items except RPM_SKIP and RPM_AUTO

Remarks
The library must be in the same place with Dynamsoft Barcode Reader Library.

LibraryParameters

Sets the parameters passed to the library to load dynamically.

Value Type Value Range Default Value Valid For
string A string value representing parameters. ”” All RegionPredetectionMode items except RPM_SKIP and RPM_AUTO
FindAccurateBoundary

Sets whether to enable finding accurate boundary.

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

Remarks

  • 0: disable.
  • 1: enable.

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 barcodes search. Default values will be used if there is no manual setting.

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

Json Parameter Example

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

 

As PublicRuntimeSettings Member

RegionPredetectionModes is a RegionPredetectionMode array defines in furtherModes which is a struct member of PublicRuntimeSettings. 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
PublicRuntimeSettings->furtherModes regionPredetectionModes RegionPredetectionMode[8]

Remarks
GetModeArgument and SetModeArgument need to be called for getting or setting the value of arguments.

See Also

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

latest version

  • Latest version
  • Version 8.6.0
  • Version 8.4.0
  • Version 8.2.5
  • Version 8.2.3
  • Version 8.2.1
  • Version 8.2.0
  • Version 8.1.3
  • Version 8.1.2
  • Version 8.1.0
  • Version 8.0.0
  • Version 7.6.0
  • Version 7.5.0
Change +
© 2003–2021 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support