Datamatrix: Code in large image does not get detected, in scaled version it works

Skip to first unread message


Jan 2, 2019, 5:06:10 AM1/2/19
to zxing

I have a camera which takes a picture of a datamatrix code. The image size is 2592x1944 pixels. The code is centered in the image and has a dimension of 830x350 pixels (yes, it is a ). The image is looking good, but the code is not detected.

However, if I scale the image in GIMP to 50 % of its original size, ZXing is able to detect the code. What is responsible for this behaviour?

Thanks for your help

Lachezar Dobrev

Jan 2, 2019, 6:09:56 AM1/2/19
to Maxwell, zxing
If possible, please attach/publish an example.
Generally scaling up and down is one of the available
transformations that many people (me including) use to increase the
detection rate.

Please remember, that ZXing is a designed to be fast at the
(relatively small) expense of not being 100% accurate.
> --
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> For more options, visit


Jan 2, 2019, 12:25:51 PM1/2/19
to zxing
Unfortunately I am not allowed to publish the example I have. If I find a different example, I will post it.

Why would scaling change anything?

Sean Owen

Jan 2, 2019, 12:37:12 PM1/2/19
to zxing
Typically it's because you're effectively blurring out some noise in the image, without losing much of the signal in the barcode.
Reply all
Reply to author
0 new messages