Dev Center
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.

How to Deal with Image Textures

In some scenes, the background of the picture may appear textured, such as a patterned background, screen stripes, etc., which may have an adverse effect on DBR, such as mislocating the barcode(s) and increasing time cost. To deal with such textures, DBR uses the parameter TextureDetectionModes. You can configure one or more modes in TextureDetectionMode. If multiple modes are configured, DBR will use each mode in turn to process the image. The enumeration of TextureDetectionMode is as follows:

Name Value Notes
TDM_SKIP 0x00000000 Skip texture detection
TDM_GENERAL_WIDTH_CONCENTRATION 0x00000002 General texture detection, default
TDM_AUTO 0x00000001 At present, this is equivalent to TDM_SKIP

When TextureDetectionMode is set to TDM_GENERAL_WIDTH_CONCENTRATION, you can control the sensitivity of texture detection through the Sensitivity parameter. The larger the value of this parameter, the more obvious the texture detection effect is. The default value is 5 and the value range is [1, 9].

Texture detection is suitable for images with a textured background. Whether texture detection is required can be determined by observing the effect of the intermediate result after binarization (IRT_BINARIZED_IMAGE). Here, we use an actual picture with screen texture to demonstrate how to use this feature.

texture-image-sample

The sample picture is as above. When we do not use the texture detection function, using the intermediate result IRT_BINARIZED_IMAGE we can observe that the texture of the picture is very serious, and it surrounds the barcode area as shown below.

binary-before-texture-detect

Now, we enable texture detection by configuring TDM_GENERAL_WIDTH_CONCENTRATION. After that, the binarized intermediate result image observed again are shown in the figure below where it ‘s evident that textures have been well handled.

binary-after-texture-detect

If, after configuring TDM_GENERAL_WIDTH_CONCENTRATION, the texture is not processed well, you can adjust the parameter Sensitivity to make further attempts.

Sample template

{
    "ImageParameter": {
        "BarcodeFormatIds": ["BF_ALL"],
        "TextureDetectionModes":[
            {
                "Mode":"TDM_GENERAL_WIDTH_CONCENTRATION", 
                "Sensitivity":5
            }
        ]
    },
    "Version": "3.0"
}

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.40
    • Version 9.6.33
    • Version 9.6.32
    • Version 9.6.31
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
Change +