×
MENU
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 | ImagePreprocessingModes

ImagePreprocessingModes

Mode Properties

ImagePreprocessingModes is a parameter for setting the mode for image preprocessing algorithms. It consisits of one or more ImagePreprocessingMode 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 ImagePreprocessingMode array “IPM_SKIP”
“IPM_AUTO”
“IPM_GENERAL”
“IPM_GRAY_EQUALIZE”
“IPM_GRAY_SMOOTH”
“IPM_SHARPEN_SMOOTH”
“IPM_MORPHOLOGY”
[“IPM_GENERAL”, “IPM_SKIP”, “IPM_SKIP”, “IPM_SKIP”, “IPM_SKIP”, “IPM_SKIP”, “IPM_SKIP”, “IPM_SKIP”]

Mode Arguments

Sensitivity

Sets the sensitivity used for gray equalization.

Value Type Value Range Default Value Valid Modes
int [1, 9] 5 “IPM_GRAY_EQUALIZE”
  • Remarks
    If you have an image with a low level of contrast, you can set the property to a larger value. A larger value means a higher possibility that gray equalization will be activated. This may cause adverse effect on images with a high level of contrast.
SmoothBlockSizeX

Sets the horizontal block size for the smoothing process.

Value Type Value Range Default Value Valid Modes
int [3, 1000] 3 “IPM_GRAY_SMOOTH”
“IPM_SHARPEN_SMOOTH”
  • Remarks
    Block size refers to the size of a pixel neighborhood used to calculate the threshold for the pixel. An appropriate value can help increase the accuracy of barcode localization.
SmoothBlockSizeY

Sets the vertical block size for the smoothing process.

Value Type Value Range Default Value Valid Modes
int [3, 1000] 3 “IPM_GRAY_SMOOTH”
“IPM_SHARPEN_SMOOTH”
  • Remarks
    Block size refers to the size of a pixel neighborhood used to calculate the threshold for the pixel. An appropriate value can help increase the accuracy of barcode localization.
SharpenBlockSizeX

Sets the horizontal block size for the sharpening process.

Value Type Value Range Default Value Valid Modes
int [3, 1000] 3 “IPM_SHARPEN_SMOOTH”
  • Remarks
    Block size refers to the size of a pixel neighborhood used to calculate the threshold for the pixel. An appropriate value can help increase the accuracy of barcode localization.
SharpenBlockSizeY

Sets the vertical block size for the sharpening process.

Value Type Value Range Default Value Valid Modes
int [3, 1000] 3 “IPM_SHARPEN_SMOOTH”
  • Remarks
    Block size refers to the size of a pixel neighborhood used to calculate the threshold for the pixel. An appropriate value can help increase the accuracy of barcode localization.
MorphOperation

Sets the morph operation for the morphology process.

Value Type Value Range Default Value Valid Modes
string “Erode”
“Dilate”
“Open”
“Close”
“Close” “IPM_MORPHOLOGY”
  • Remarks
    • “Erode”: Perform erosion process.
    • “Dilate”: Perform dilation process.
    • “Open”: Perform erosion first, then perform dilation.
    • “Close”: Perform dilation first, then perform erosion.

    For more information, please check out Image Processing in OpenCV - Morphological Transformations for reference.

MorphShape

Sets the morph shape for the morphology process.

Value Type Value Range Default Value Valid Modes
string “Rectangle”
“Cross”
“Ellipse”
“Rectangle” “IPM_MORPHOLOGY”
  • Remarks
    • “Rectangle”:
    • “Cross”:
    • “Ellipse”:
MorphOperationKernelSizeX

Sets the horizontal kernel size for the morphology process.

Value Type Value Range Default Value Valid Modes
int [0, 1000] 0 “IPM_MORPHOLOGY”
MorphOperationKernelSizeY

Sets the vertical kernel size for the morphology process.

Value Type Value Range Default Value Valid Modes
int [0, 1000] 0 “IPM_MORPHOLOGY”
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 ImagePreprocessingMode items except IPM_SKIP and IPM_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 Modes
string A string value representing parameters. ”” All ImagePreprocessingMode items except IPM_SKIP and IPM_AUTO

Setting Methods

As JSON Parameter

ImagePreprocessingModes 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 mode for image preprocessing algorithms. Default values will be used if there is no manual setting.

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

Json Parameter Example

{
    "ImagePreprocessingModes": [
        {
            "Mode": "IPM_GRAY_EQUALIZE",
            "Sensitivity": 5
        },
        {
            "Mode": "IPM_SHARPEN_SMOOTH",
            "SmoothBlockSizeX": 5,
            "SmoothBlockSizeY": 5,
            "SharpenBlockSizeX": 5,
            "SharpenBlockSizeY": 5
        }
    ]
}

 

As PublicRuntimeSettings Member

ImagePreprocessingModes is a ImagePreprocessingMode array defines in furtherModes which is a struct member of PublicRuntimeSettings. It is used for setting the modes and the priority for image preprocessing algorithms. Default value will be used if there is no manual setting.

Struct Struct Member Name Value Type
PublicRuntimeSettings->furtherModes imagePreprocessingModes ImagePreprocessingMode[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

Is this page helpful?

YesYes NoNo

latest version

  • Latest Version
  • version 8.1.2
  • version 8.0
  • version 7.6
  • version 7.5
Change +
© 2003–2020 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support