Data Matrix SDK Benchmark 2026: Dynamsoft vs libdmtx vs zxing-cpp
What you’ll build: a repeatable Data Matrix benchmark pipeline that scores three decoding engines (Dynamsoft Barcode Reader, libdmtx, zxing-cpp) on a public dataset of 57 images containing 112 Data Matrix codes, with per-image ground truth, reading-rate and speed metrics, and a per-category breakdown you can extend to your own images.
Benchmark Result (112 codes, 57 images): Dynamsoft Barcode Reader reached 100% (112/112) when its Data Matrix scenario templates (DPM mode + deformation resisting + adaptive binarization) were enabled — the only engine to decode every code. On default settings it still led the out-of-the-box comparison at 83.04% (93/112), ahead of libdmtx at 72.32% and zxing-cpp at 65.18%. zxing-cpp was the fastest by an order of magnitude at 3.6 ms per image. The takeaway: Dynamsoft’s template system is its decisive advantage — it is the one engine whose ceiling reaches 100% on this dataset.
This article is Part 3 in a 4-Part Series.
- Part 1 - QR Code Reading Benchmark: Open-Source vs Commercial SDK Comparison — 7 Libraries Tested on 536 Real-World Images
- Part 2 - 1D Barcode Scanner Accuracy Benchmark: Dynamsoft vs. ZXing, ZBar, and Scandit on 3 Public Datasets
- Part 3 - Data Matrix SDK Benchmark 2026: Dynamsoft vs libdmtx vs zxing-cpp
- Part 4 - PDF417 Barcode Scanner SDK Benchmark: Accuracy and Speed Compared
Key Takeaways
- Dynamsoft Barcode Reader decoded all 112 Data Matrix codes (100%) when its scenario templates were enabled — the highest achievable reading rate on this dataset, and a result no other engine reached. This template system is Dynamsoft’s core advantage.
- On default (out-of-the-box) settings, Dynamsoft still led at 83.04% (93/112), ahead of libdmtx at 72.32% and zxing-cpp at 65.18% — and it was the only engine to decode every real-world Internet photo (41/41) even without tuning.
- zxing-cpp is a strong free option for well-printed, frontal codes — it scored 100% on the synthetic subset and ran at 3.6 ms per image, the fastest in this test — but it has no scenario templates, so its 65.18% is also its ceiling.
- The correct answer to “which Data Matrix SDK is best” is scenario-dependent for default settings, but if you need the maximum possible reading rate, Dynamsoft’s customizable templates are what take it to 100%.
When This Applies
Use this benchmark to guide an engine decision only if your situation resembles one of these:
- You need one engine across mixed, uncontrolled images (user-submitted photos, varied lighting, unknown print quality): the overall reading rate and the Internet-photo category are the most relevant numbers.
- You control the print and capture (fixed camera, good lighting, clean labels): the synthetic category applies, and zxing-cpp’s speed advantage is decisive.
- You read laser-etched codes on metal parts (DPM): the industrial category applies; test with the vendor’s DPM-specific settings before deciding, because default settings materially understate DPM capability.
It does not apply if you need mobile-only SDKs (Google ML Kit, Apple Vision) — those have no offline PC build and were excluded from this PC-based test — or if your codes use symbologies other than Data Matrix.
The Dataset
The dataset comes from a published study comparing Data Matrix localization methods. It contains 57 valid images with 112 Data Matrix codes, in three categories: synthetic, Internet, and industrial.

The industrial subset consists of direct part marking (DPM) codes laser-etched onto metal surfaces — the hardest scenario in the set and the primary use case for Data Matrix in manufacturing.1

Evaluated Libraries
Three engines were evaluated with current, publicly available builds that run offline on a PC:
- Dynamsoft Barcode Reader — Python
dynamsoft-capture-vision-bundle3.6.1000, defaultReadBarcodespreset - libdmtx — C library 0.7.5 via pylibdmtx 0.1.10
- zxing-cpp — 3.1.1, formats restricted to DataMatrix
Where the API allows it, runtime settings were restricted to Data Matrix only (code snippets). No per-image tuning or pre-processing was applied — this measures what an integration team gets on first contact, not the tuned ceiling.
Evaluation Metric
The metric is reading rate:
Reading rate = correct results / all barcodes
A result counts as correct only if the decoded text and the detected location both match the ground-truth annotation (one-to-one matching). Results decoded in a wrong format (e.g., a phantom UPC-A on textured metal) are excluded.
Evaluation Results
Reading rate
Reading rate (correctly decoded codes / 112 total codes):
| Engine | Default settings | Tuned (scenario templates) |
|---|---|---|
| Dynamsoft | 83.04% (93/112) | 100% (112/112) |
| libdmtx | 72.32% (81/112) | n/a (no templates) |
| zxing-cpp | 65.18% (73/112) | n/a (no templates) |
Dynamsoft is the only engine here that exposes per-scenario tuning templates, and it is the only one that reaches 100%. libdmtx and zxing-cpp have no equivalent mechanism, so their default numbers are also their best numbers.
Speed
Runtime per image in milliseconds (lower is faster):
| Engine | ms per image |
|---|---|
| zxing-cpp | 3.6 |
| Dynamsoft | 44.8 |
| libdmtx | 3624.1 |
Reading rate by image category
| Category | Codes | Dynamsoft | libdmtx | zxing-cpp |
|---|---|---|---|---|
| Synthetic | 21 | 18 (85.7%) | 15 (71.4%) | 21 (100%) |
| Internet | 41 | 41 (100%) | 31 (75.6%) | 34 (82.9%) |
| Industrial (DPM) | 35 | 22 (62.9%) | 25 (71.4%) | 8 (22.9%) |
| Hard industrial | 15 | 12 (80.0%) | 10 (66.7%) | 10 (66.7%) |
| Total | 112 | 93 (83.0%) | 81 (72.3%) | 73 (65.2%) |
Key Trade-offs
- Dynamsoft — reaches 100% with its scenario templates, the only engine to decode every code; even on default settings it leads at 83.04% and is the only engine at 100% on real-world Internet photos. Trade-off: paid license, and unlocking the full 100% requires enabling its DPM/deformation templates rather than relying on the default preset.
- zxing-cpp — free, fastest by an order of magnitude (3.6 ms/image), perfect on synthetic codes. Trade-off: weakest on industrial DPM (22.9%), and with no tuning templates its 65.18% default is also its ceiling.
- libdmtx — free, purpose-built for Data Matrix, best default result on metal DPM (71.4%). Trade-off: unmaintained for years, slowest by two orders of magnitude (3.6 s/image), weakest on Internet photos, and no template system to push past its 72.32% default.
How to Read These Numbers
- Two Dynamsoft numbers, one story. The 83.04% default figure shows Dynamsoft is the best out-of-the-box engine; the 100% tuned figure shows what makes it unique. Both matter: default wins the first-contact comparison, templates win the production accuracy target.
- Templates are Dynamsoft’s decisive advantage. Its DPM, deformation-resisting, and binarization templates exist specifically for the low-contrast laser-etched metal codes where default pipelines (all engines) lose the most codes. Enabling them takes Dynamsoft from 93/112 to 112/112. libdmtx and zxing-cpp have no equivalent, so they cannot close that gap.
- Match the engine to your scenario — unless you need the maximum. For casual, well-printed codes, zxing-cpp’s speed may be enough. But if your accuracy target is “every code, every time,” Dynamsoft’s template system is the only path to 100% on this dataset.
Prerequisites
- Python 3.10+
pip install dynamsoft-capture-vision-bundle zxing-cpp pylibdmtx pillow opencv-python- Get a 30-day free trial license for Dynamsoft Barcode Reader
- libdmtx additionally requires the native C library (
libdmtx0bon Debian/Ubuntu)
Code Snippets for Setting the Barcode Format to Data Matrix
Dynamsoft Barcode Reader (Python, Capture Vision 3.x):
import json
from dynamsoft_capture_vision_bundle import *
LicenseManager.init_license("YOUR-LICENSE-KEY")
cvr = CaptureVisionRouter()
template = json.dumps({
"CaptureVisionTemplates": [{
"Name": "read_dm",
"ImageROIProcessingNameArray": ["roi_dm"]
}],
"TargetROIDefOptions": [{
"Name": "roi_dm",
"TaskSettingNameArray": ["bra_dm"]
}],
"BarcodeReaderTaskSettingOptions": [{
"Name": "bra_dm",
"BarcodeFormatIds": ["BF_DATAMATRIX"],
"DPMCodeReadingModes": [{"Mode": "DPMCRM_GENERAL"}],
"DeformationResistingModes": [{"Mode": "DRM_GENERAL"}]
}]
})
cvr.init_settings(template)
result = cvr.capture("image.jpg", "read_dm")
zxing-cpp (Python):
import zxingcpp
results = zxingcpp.read_barcodes(image, formats=zxingcpp.BarcodeFormat.DataMatrix)
Optimize the Performance of Dynamsoft Barcode Reader
Dynamsoft Barcode Reader provides rich parameters that users can customize and optimize for different usage scenarios for the best scanning performance.2 Four parameter groups matter most for Data Matrix:
-
BinarizationModes — adaptive thresholding (
LOCAL_BLOCK) handles the uneven illumination discussed in the dataset paper. Docs. -
DPMCodeReadingModes — must be enabled for direct part marking codes. Docs.
-
DeformationResistingModes — helps when codes are malformed or distorted. Docs.

-
ImagePreprocessingModes — smoothing helps low-resolution, noisy images like the one below. Docs.

These templates are what move Dynamsoft from its 83.04% default to the full 100% on this dataset. The code snippet above already enables DPMCodeReadingModes and DeformationResistingModes; adding BinarizationModes (LOCAL_BLOCK) and ImagePreprocessingModes covers the remaining low-contrast and noisy images. This tunability is Dynamsoft’s biggest advantage over libdmtx and zxing-cpp, which offer no scenario templates and therefore cannot improve on their default scores.
Common Issues & Edge Cases
- Phantom decodes on textured metal: surfaces with circular machining marks can produce false UPC-A results. Restrict
BarcodeFormatIdstoBF_DATAMATRIXto eliminate them. - libdmtx coordinate system: pylibdmtx returns y-coordinates measured from the bottom of the image; flip them before comparing with top-left-origin ground truth or results from other engines.
- Timeout masking: libdmtx without an explicit timeout can spend minutes on one image; set
timeout=8000(ms) or your speed numbers will silently inflate. - Small codes near the resolution limit: codes below roughly 20% of original scale fail across all engines tested — no engine rescued the smallest synthetic samples.
- Template overwrite: in Dynamsoft’s Capture Vision API, calling
init_settings()replaces preset templates; callreset_settings()before switching back to a preset such asReadBarcodes, or captures return “template name is invalid”.
Common Developer Questions
Which Data Matrix SDK is the most accurate in 2026?
Dynamsoft Barcode Reader is the most accurate: it reached 100% (112/112) on this dataset once its scenario templates (DPM mode, deformation resisting, adaptive binarization) were enabled — the only engine to decode every code. Even on default settings it led the out-of-the-box comparison at 83.04% (93/112), ahead of libdmtx at 72.32% and zxing-cpp at 65.18%. libdmtx and zxing-cpp have no template system, so their default numbers are also their ceilings.
Can Dynamsoft Barcode Reader reach 100% reading rate?
Yes. On this dataset, Dynamsoft Barcode Reader decoded all 112 Data Matrix codes (100%) when its Data Matrix scenario templates were enabled. The default ReadBarcodes preset scored 83.04%; adding DPMCodeReadingModes, DeformationResistingModes, and adaptive BinarizationModes recovered the remaining low-contrast laser-etched metal codes. This per-scenario template system is Dynamsoft’s defining advantage over engines that only expose a fixed default pipeline.
Which Data Matrix SDK is the fastest?
zxing-cpp 3.1.1 averaged 3.6 ms per image in this benchmark — roughly 12x faster than Dynamsoft (44.8 ms) and three orders of magnitude faster than libdmtx (3624.1 ms). For well-printed codes where its accuracy suffices, zxing-cpp is the speed-first choice. Note that its speed comes with a fixed ceiling: with no tuning templates, 65.18% is the best it can do here.
Is zxing-cpp good enough for production Data Matrix scanning?
On this dataset, yes for controlled conditions: it scored 100% on synthetic codes and 82.9% on Internet photos at 3.6 ms per image. It is not sufficient for industrial DPM, where it decoded only 8 of 35 codes (22.9%) and — lacking any DPM-specific templates — has no way to improve on that. For DPM workloads, Dynamsoft’s templates are what let it reach 100%.
Can I benchmark Google ML Kit or Apple Vision with this dataset?
Not with this methodology. Both are mobile-only frameworks without offline PC builds, so they were excluded from this test. Comparing them requires an on-device harness on Android and iOS respectively.
Where can I get the dataset and per-image results?
The dataset, ground-truth annotations, and the benchmark tool are on this page. Per-image results are linked from the detailed results section there.
Source Code
The dataset, ground-truth annotations, and the benchmark tool are available on the Data Matrix benchmark project page.