Hello.
The code does not look bad. Although if you're only scanning for a
particular bar-code you could skip the multi-format wrapper and use
the designated bar-code reader, in your case the
com.google.zxing.oned.Code128Reader, but that is up to you, and has
little effect.
Your observation is not wrong. ZXing has been designed to perform
quick scans with less-than-perfect success rate, and instead perform
large number of successive tests since it works with a video source.
That does make it less-reliable when using a single image to decode
(like those from a document scanner for instance). Hence sometimes
distorting the original image may actually yield better results.
So it may prove to be beneficial to perform a combination of
distortions on the image and perform multiple attempts to scan the
image.
I commonly make various combinations of scaling-down and blurring
the image, which have proved quite effective in decoding bar-codes
(well QR codes) embedded in scanned documents.
In fact I tried your image with a 3x3 blur and it decoded fine (with
the TRY_HARDER hint).
If your application is designed to run on a regular machine (not
phone and not tablet) you might consider adding distortions and giving
it a second attempt (or third, or fourth).
> --
> 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
zxing+un...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.