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 deformed barcodes

The barcodes on the surface of some flexible packaging or cylindrical objects tend to be distorted and deformed. DBR may not be able to handle such cases well by default, but we can configure DeformationResistingModes to deal with these problems.

The following images show two kinds of barcode images with deformation:

Wrinkled distortion: Deformation sample image1 after deformation qr

Columnar distortion:

Deformation sample image2 Deformation sample image2

Currently, DeformationResistingModes only works for QR Code and DataMatrix codes.

How to configure

As mentioned above, you can configure the anti-deformation mode via the setting DeformationResistingModes. DBR does not turn on anti-deformation by default. If you want to turn it on, you need to add DRM_GENERAL to DeformationResistingModes. By the way, multiple modes can also be set at the same time. For example, if DRM_SKIP and DRM_GENERAL are configured at the same time, our algorithm will try to turn off and turn on the anti-deformation mode in turn, until the decoding result meets the requirements.


The following code snippet shows how to enable deformation resisting mode via RuntimeSettings and JSON template individually.

  • Set via RuntimeSettings:
CBarcodeReader* reader = new CBarcodeReader();  
reader->InitLicense("Insert your license");  
PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings();  
reader->GetRuntimeSettings(runtimeSettings); //Get the current runtimesettings  
runtimeSettings->furtherModes.deformationResistingModes[0] = DRM_GENERAL; // Turn on anti-deformation
char sError[512];  
reader->UpdateRuntimeSettings(runtimeSettings, sError, 512); // Update the runtimesettings
reader->DecodeFile("Insert your image file path", ""); // Start decoding
TextResultArray* paryResult = NULL;  
reader->GetAllTextResults(&paryResult); // Get results
delete runtimeSettings;  
delete reader;  
  • Set via JSON template:

This page is compatible for:

Version 7.5.0

Is this page helpful?

YesYes NoNo

version 7.6.0

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