ZXing Library Finds DataMatrix In Android But Not Eclipse

68 views
Skip to first unread message

Karl

unread,
Jun 14, 2013, 3:14:57 PM6/14/13
to zx...@googlegroups.com
Hello,

I am developing an application that needs to read Data Matrix bar codes. Using the ZXing library I am having trouble reliably getting a reading. The system that I am using has an internal CMOS camera with 400 lines of resolution. Using a robotic arm, I am navigating to the bar code and then using the ZXing library to read it from an image. The problem I am having is a high failure rate ~20%. What is really puzzling to me is that when I use the "Barcode Scanner by ZXing Team" app I can read Data Matrix barcodes that my code will not. From this it would seem to me that my implementation is not correct. Attached I have included on of the images that is read on my phone but gets a "Checksum Exception" when read via Eclipse. 




In addition, here is my implementation:

 Hashtable<DecodeHintType, Object> hint = new Hashtable<DecodeHintType, Object>();
 hint.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);

LuminanceSource source = new BufferedImageLuminanceSource(img1);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

Reader reader = new DataMatrixReader();
Result result = reader.decode(bitmap, hint);
return result.getText();

I am hoping someone has had similar issues and can help.

Thanks,
 

Sean Owen

unread,
Jun 14, 2013, 5:18:53 PM6/14/13
to zx...@googlegroups.com
I don't know, try the other binarizer? A 20% failure rate might be 'normal'. The app is scanning a series of images and so is not trying to spend time scanning each frame, but will 'pass' and try the next one quickly. You are right to use TRY_HARDER if you need one image to scan. Make sure there is sufficient white space too and get as clean a shot as possible.
Reply all
Reply to author
Forward
0 new messages