Zxing decode codes 39 (VIN number)

155 views
Skip to first unread message

Jakub Porzuczek

unread,
Aug 21, 2013, 6:37:52 AM8/21/13
to zx...@googlegroups.com
Hello. I saw that many people asked about zxing and long codes 39 decoding, and there were voices that it works, and there were that it doesn't. I included Zxing into my project and done as much tweaking as configuration let me: I've changed preview size to maximum possible, I made framing rectangle wider and smaller in height, I restricted formats to only CODE_39, MAX and MIN code length to 17 and I asked library to TRY_HARDER. I tried various combinations of those. First of all I tested on Samsung Galaxy S4 (full hd screen and big preview size here) and it seemed to work on clear and visible codes. When I tried same app on HTC Sensation (which is also not bad phone) none of codes were recognized. Then I tried on couple more phones and I can say that almost no codes were recognized. In meantime I used some paid solution build for VIN only and it worked almost instantly on most of the codes, even blurred ones.
So my question here: can I do something more to adjust Zxing as it is to recognize long 39 codes? According to Sean Owen responses here http://stackoverflow.com/questions/8148086/how-to-read-long-code-39-barcodes-with-zxing there is not. So I would like to ask about barcode/algorithms background information that can allow me to get deeper into the matter and tweak current algorithms for VIN.

Sean Owen

unread,
Aug 21, 2013, 6:45:35 AM8/21/13
to zx...@googlegroups.com
It works well for me on a Nexus 4, but it's by no means a specialist app. "well" is relative. 
I am not sure what modifications you made, but they don't necessarily improve scanning. For example, if the code is small and you widen the reticle, you will be too close to focus.
I improved scanning in the + app with a different binarizer, so you could investigate writing more specialized binarizers there.
WYSIWYG on this project.

Jakub Porzuczek

unread,
Aug 21, 2013, 7:17:50 AM8/21/13
to zx...@googlegroups.com
I widen the rectangle, as well as tried smaller ones (smallest one was around 50% of device width). VIN numbers used for testing were rather big. If I would find that + app works good enough on my data, can you give me instruction how to implement more specialized binarizers?

Sean Owen

unread,
Aug 21, 2013, 9:12:15 AM8/21/13
to zx...@googlegroups.com
Instructions? It's hardly trivial. I think there are two main ways you could explore an improvement:

1. Implement a real edge detector. I did this and it gives "moderate" improvement in detection.
2. Build a neural network to learn what encoded characters look like in blurred form. This is quite complex and I have not tried it but I expect this is how really good specialized scanners work.

Jakub Porzuczek

unread,
Aug 21, 2013, 9:51:52 AM8/21/13
to zx...@googlegroups.com
I can imagine that it is not trivial task. Thanks for your help, I really appreciate it. 
Reply all
Reply to author
Forward
0 new messages