Locating/decoding data matrix with Java

62 views
Skip to first unread message

Marshall Pierce

unread,
Aug 5, 2013, 5:35:15 PM8/5/13
to zx...@googlegroups.com
I'm having trouble getting data matrix decoding to work. Eventually I'll want to locate and decode a data matrix that's part of a larger image, but for now I'm just trying to get a data matrix roundtrip (some text -> data matrix -> back to text).


A quick 'gradle test' should show that testDataMatrix is failing, while testQR (which is identical except for the barcode format) succeeds. 

What am I doing wrong? Thanks for any suggestions.

-Marshall
zxing.png

Sean Owen

unread,
Aug 5, 2013, 5:52:48 PM8/5/13
to zx...@googlegroups.com
My guess is that it's the lack of quiet zone. It works fine with PURE_BARCODE mode, which is what you should use when decoding synthetic images like this. You could look into the code to see about relaxing the assumption about quiet zone -- so that beyond the edge of the image is implicitly quiet zone. This is how others work.

Marshall Pierce

unread,
Aug 5, 2013, 6:24:30 PM8/5/13
to zx...@googlegroups.com
Ah, I see. I didn't realize that sort of thing varied between the various decoders. Interestingly, I see that the QRCodeReader does have different behavior for PURE_BARCODE, yet it worked fine without it.

Anyway, thanks for clarifying.
Reply all
Reply to author
Forward
0 new messages