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.

Read Deformed Barcodes

As shown below, barcodes on the surface of some flexible packaging or cylindrical objects tend to be distorted and deformed.

Deformed Barcodes

Deformed Barcodes

By default, Dynamsoft Barcode Reader (DBR) may not handle such cases well. To get such images decoded, enable deformation resistance by adding DRM_BROAD_WARP, DRM_LOCAL_REFERENCE and DRM_DEWRINKLE to DeformationResistingModes. Here is a quick breakdown of each of the modes:

  • DRM_BROAD_WARP: Resists deformation when the barcode is warped gently.
  • DRM_LOCAL_REFERENCE: Resists deformation for barcodes with minor deformation in local modules.
  • DRM_DEWRINKLE: Resists deformation for barcodes on a wrinkled surface.

Note:

DeformationResistingModes only works for QR Code and DataMatrix codes.

You can either specify one of the DeformationResistingModes or add all of them. If mulpitle modes are specified, the library will switch between the modes automatically until the number of detected barcodes meets the ExpectedBarcodeCount.

Sample Code

Below is an example illustrating how to configure the parameter DeformationResistingModes.

  • update parameter DeformationResistingModes in your JSON template

      {
          "CaptureVisionTemplates": [
              {
                  "Name": "CV_0",
                  "ImageROIProcessingNameArray": ["TA_0" ]
              }       
          ],
          "TargetROIDefOptions" : [
              {
                  "Name": "TA_0",
                  "TaskSettingNameArray": [ "BR_0" ]
              }
          ],
          "BarcodeReaderTaskSettingOptions": [
              {
                  "Name" : "BR_0",
                  "DeformationResistingModes": [
                      {
                          "Mode": "DRM_BROAD_WARP"
                      },
                      {
                          "Mode": "DRM_LOCAL_REFERENCE"
                      }
                  ]
              }
          ]
      }
    
  • apply settings by calling method InitSettingsFromFile

  • C++
  • Android
  • Objective-C
  • Swift
char szErrorMsg[256] = {0};
CCaptureVisionRouter* cvr = new CCaptureVisionRouter;
cvr->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", szErrorMsg, 256);
// more process here
try {
   // `cvr` is an instance of `CaptureVisionRouter`.
   cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE");
} catch (CaptureVisionRouterException e) {
   e.printStackTrace();
}
NSError *error;
// `cvr` is an instance of `DSCaptureVisionRouter`.
[self.cvr initSettingsFromFile:@"PATH-TO-YOUR-SETTING-FILE" error:&error];
do{
   //`cvr` is an instance of `CaptureVisionRouter`.
   try cvr.initSettingsFromFile("PATH-TO-YOUR-SETTING-FILE")
}catch{
   // Add code to do when error occurs.
}

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 +