0

I'm trying to decode aztec codes from images using zxing library.

Images looks more or less like this:

https://imgur.com/a/5ExPy6q

So far my results are quite random.

I've tried a few image processing actions using imagemagick such as:

convert -brightness-contrast 50x20 in.png out.png
convert -colorspace Gray in.png out.png

And there was improvement but still most of codes fails to decode.

What specific image preprocessing actions should I do for such barcodes ?

4

1 回答 1

0

您可以在 Imagemagick 中尝试 -lat(局部区域阈值)。例如:

输入:

在此处输入图像描述

convert barcode.png -colorspace gray -negate -lat 20x20+10% -negate result.png


在此处输入图像描述

您可以通过添加 -morphology close 来稍微改进一下:

convert barcode.png -colorspace gray -negate -lat 20x20+10% -negate -morphology open diamond:1 result2.png


在此处输入图像描述

于 2019-01-29T01:20:06.593 回答