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 settings (higher expected barcode count, full localization and full-resolution input) were enabled — the only engine to decode every code. On default settings it still led the out-of-the-box comparison at 84.82% (95/112), ahead of libdmtx at 72.32% and zxing-cpp at 65.18%. zxing-cpp was fastest at 3.6 ms per image. The takeaway: Dynamsoft’s runtime tuning 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.
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 84.82% (95/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 sit outside this PC-based comparison — 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.5000, defaultReadBarcodes_Defaultpreset - 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 | 84.82% (95/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 | 11.4 |
| 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 | 23 (65.7%) | 25 (71.4%) | 8 (22.9%) |
| Hard industrial | 15 | 13 (86.7%) | 10 (66.7%) | 10 (66.7%) |
| Total | 112 | 95 (84.8%) | 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 84.82% and is the only engine at 100% on real-world Internet photos. Trade-off: paid license, and unlocking the full 100% requires raising the expected barcode count and enabling the full localization list.
- 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 84.82% 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, runtime tuning wins the production accuracy target.
- Runtime tuning is Dynamsoft’s decisive advantage. Its
expected_barcodes_countandlocalization_modessettings address the multi-code and low-contrast laser-etched metal images where default pipelines (all engines) lose the most codes. Enabling them takes Dynamsoft from 95/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.6.5000):
from dynamsoft_capture_vision_bundle import (
CaptureVisionRouter, LicenseManager, EnumBarcodeFormat, EnumLocalizationMode as LM,
)
LicenseManager.init_license("YOUR_LICENSE_KEY")
cvr = CaptureVisionRouter()
code, message, settings = cvr.get_simplified_settings("ReadBarcodes_Default")
settings.barcode_settings.barcode_format_ids = EnumBarcodeFormat.BF_DATAMATRIX
settings.barcode_settings.expected_barcodes_count = 10
settings.barcode_settings.localization_modes = [
LM.LM_CONNECTED_BLOCKS, LM.LM_LINES, LM.LM_STATISTICS, LM.LM_SCAN_DIRECTLY,
LM.LM_NEURAL_NETWORK, LM.LM_STATISTICS_MARKS, LM.LM_CENTRE, -1,
]
settings.barcode_settings.scale_down_threshold = 99999
cvr.update_settings("ReadBarcodes_Default", settings)
result = cvr.capture("image.jpg", "ReadBarcodes_Default")
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 runtime parameters that users can customize for different image conditions.2 On Capture Vision 3.6.5000, three settings matter most for this multi-code Data Matrix dataset:
-
expected_barcodes_count — the default of 0 finds about one code per image. These 57 images contain up to five codes each, so raising it to 10 recovers most of the missing results.
-
localization_modes — enabling connected-block, lines, statistics, scan-directly, neural-network, marks and centre localization finds the remaining small or distorted codes.
-
scale_down_threshold — keeping the originals at full resolution avoids losing module detail on the low-resolution industrial images.


Together they move Dynamsoft from 84.82% default to 100% (112/112) on this dataset, at 54.13 ms per image. On the older 3.6.1000 build the equivalent result came from a JSON template using DPMCodeReadingModes, DeformationResistingModes and adaptive BinarizationModes; DeformationResistingModes is no longer accepted by the 3.6.5000 template loader, so the current runner uses SimplifiedCaptureVisionSettings instead. This tunability is Dynamsoft’s biggest advantage over libdmtx and zxing-cpp, which offer no equivalent mechanism 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 (expected barcode count, full localization, full-resolution input) were enabled — the only engine to decode every code. Even on default settings it led the out-of-the-box comparison at 84.82% (95/112), ahead of libdmtx at 72.32% and zxing-cpp at 65.18%. libdmtx and zxing-cpp have no equivalent tuning mechanism, 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_Default preset scored 84.82%; raising expected_barcodes_count to 10 and enabling the full localization_modes list recovered the remaining multi-code and low-contrast laser-etched metal codes. This runtime tuning 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 3x faster than Dynamsoft (11.4 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 sit outside this comparison. 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.
Reproducibility
A reading rate without a dataset is an opinion; a reading rate without code is an assertion. Both are published here, so the two Dynamsoft numbers above can be checked instead of trusted.
| What you need | Where it is |
|---|---|
| 57 images and 112 ground-truth Data Matrix codes | project page, project_manifest.json (811 B, SHA-256 fc038a713cd3…) |
| Per-image output | results.zip (158,701 B, SHA-256 25a889f203a2…) |
| The runner | examples/official/benchmark-legacy/data_matrix |
python common/download_dataset.py --project DataMatrix --output datasets/DataMatrix
python common/benchmark_dynamsoft.py \
--dataset datasets/DataMatrix --project DataMatrix --output datasets/DataMatrix/current_run
The runner pins dynamsoft-capture-vision-bundle==3.6.5000 and reproduces both figures in this article: 84.82% with SDK defaults and 100% with --tuning accuracy. Matching is one-to-one on decoded text plus detected location, so a phantom code on textured metal cannot inflate a score. Full A/B results are in the repository README.