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 read DPM codes

What is DPM (Direct Part Marking)?

It is the process of creating permanent markings on the surface of a part to help identify it. DPM Codes are used widely in industrial part tracking, from electronics manufacturing to automotive assembly. Atypical from general scenarios, DPM Codes present more challenges, including light reflection interference from the surface the code is printed on, low contrast, and complex background texture. DBR may not be able to handle these problems well by default, so this is where the parameter DPMCodeReadingModes comes handy.

For reference, here are two sample images of DPM codes:

DPM sample image1 DPM sample image2

How to configure the Barcode Reader to read DPM Codes

To enable the DPM feature, you first need to add LM_STATISTICS_MARKS to the LocalizationModes and then add DPMCRM_GENERAL to DPMCodeReadingModes.

LM_STATISTICS_MARKS is a dot matrix-based localization method specifically for DPM code and DotCode. For the allowed enumeration values of DPMCodeReadingModes, please refer to its documentation page.

In order to facilitate the configuration, adding DPMCRM_GENERAL to DPMCodeReadingModes automatically adds LM_STATISTICS_MARKS to LocalizationModes. Therefore, if you would like to enable DPM, you only need to set DPMCodeReadingModes to DPMCRM_GENERAL.

Example

The following code snippet shows how to read DPM code via RuntimeSettings and JSON template individually.

  • Set via RuntimeSettings:
    CBarcodeReader* reader = new CBarcodeReader();  
    reader->InitLicense("insert your license here");  
    PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings();  
    reader->GetRuntimeSettings(runtimeSettings); //Get the current RuntimeSettings  
    runtimeSettings->furtherModes.dpmCodeReadingModes[0] = DPMCRM_GENERAL; // Turn on DPM reading mode
    char sError[512];  
    reader->UpdateRuntimeSettings(runtimeSettings, sError, 512); // Update RuntimeSettings
    reader->DecodeFile("insert your image file path here", ""); // Start decoding
    TextResultArray* paryResult = NULL;  
    reader->GetAllTextResults(&paryResult); // Get results
    CBarcodeReader::FreeTextResults(&paryResult);  
    delete runtimeSettings;  
    delete reader;  
    
  • Set via JSON template
    {    
      "Version":"3.0",    
      "ImageParameter":    
      {    
           "Name":"IP1",    
           "BarcodeFormatIds":["BF_ALL"],        
           "DPMCodeReadingModes":["DPMCRM_GENERAL"]
       }    
    }   
    

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 +