Zxing JAVA : Unable to read some EAN128 bar code

62 views
Skip to first unread message

Johan Bole besançon

unread,
Feb 23, 2018, 11:41:49 AM2/23/18
to zxing
Hello,

Im using Zxing to read EAN128 on tiff files in JAVA.

There is about 2% of the bar code that are not recognize by my application.
Im using the latest version. I have tried to recognize the code with phone apps and it work properly.

I am using TwelveMonkeys imageio to get a BufferedImage from the tiff file,
then i transform it to a BinaryBitmap

LuminanceSource source = new BufferedImageLuminanceSource(bufferedImage);
BinaryBitmap fullBinaryBitmap = new BinaryBitmap(new HybridBinarizer(source));

And i search the bar code with
Map<DecodeHintType, Object> hintMap = new HashMap<DecodeHintType, Object();
hintMap.put(DecodeHintType.TRY_HARDER, true);
genericMultipleBarcodeReader.decodeMultiple(binaryBitmap, hintMap);

Please, find in attachment an example.
Did i miss something ?

Regards

cdns.tif

Lachezar Dobrev

unread,
Feb 26, 2018, 5:21:24 AM2/26/18
to Johan Bole besançon, zxing
The black lines are too wide and/or the white lines are too thin.
Scaling the image 2x up and trimming the black zones 1 pixel yields
the attached image, that reads just fine.

I suspect that the resolution of the generated image was sufficient
to handle the length of the bar-code, and the bar-codes fall victim of
the ±1px problem.
> --
> 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.
cdns.png

Johan Bole besançon

unread,
Mar 1, 2018, 4:45:54 AM3/1/18
to zxing
Hello,
The original file has a 200dpi Horizontal and Vertical resolution ( 1653*2339)

I don't think i will find an easy solution for this problem, I guess i will have to try other SDK

Anyway, thank you a lot for taking the time to check what could be wrong with my sample.

Regards


Reply all
Reply to author
Forward
0 new messages