EddieLa / JOB

A Barcode scanner capapable of reading Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar and EAN-13 barcodes in javascript.
http://eddiela.github.io/JOB
600 stars 204 forks source link

Problem with Code 39 decoding #28

Open jasonwiener opened 9 years ago

jasonwiener commented 9 years ago

Hi. I'm having problems with decoding Code 39 barcodes if they're not absolutely pristine.

Though, they'll successfully decode using the online test tool at http://zxing.org/w/decode.jspx

Here's the only one I've been able to successfully get the lib to do: https://decalrestore.files.wordpress.com/2013/01/1996-07-bar-code-decal1.png

Here are some that fail (but work on zxing). http://images.gtcarlot.com/pictures/57758092.jpg http://www.e90post.com/forums/e90garageimg/563/BMW%20VIN%20small.JPG

eagunn commented 9 years ago

Jason, Did you ever resolve this issue? Or choose another library that handled VIN pictures better? I ask because I need to integrate barcode scanning for VINs into a website and I think I will have the same issue. I can decode a vin picture on the zxing site that I can't decode with the job demo webiste. ag

jasonwiener commented 9 years ago

Hi. No. Never resolved it. Decided to use the HP Idol service as a server side stopgap solution. 

On Mon, Mar 9, 2015 at 1:12 PM -0700, "Anne Gunn" notifications@github.com wrote:

Jason,

Did you ever resolve this issue? Or choose another library that handled VIN pictures better? I ask because I need to integrate barcode scanning for VINs into a website and I think I will have the same issue. I can decode a vin picture on the zxing site that I can't decode with the job demo webiste.

ag

— Reply to this email directly or view it on GitHub.

eagunn commented 9 years ago

Jason, Thanks for getting back to me. I may start, then, with this library: https://serratus.github.io/quaggaJS/ which looks nice but only just added support for Code 39 barcodes.

Eddie, Jason,

If I get quaggajs working, I'll report back on my results.

ag

On Mon, Mar 9, 2015 at 2:15 PM, Jason Wiener notifications@github.com wrote:

Hi. No. Never resolved it. Decided to use the HP Idol service as a server side stopgap solution.

On Mon, Mar 9, 2015 at 1:12 PM -0700, "Anne Gunn" < notifications@github.com> wrote:

Jason,

Did you ever resolve this issue? Or choose another library that handled VIN pictures better? I ask because I need to integrate barcode scanning for VINs into a website and I think I will have the same issue. I can decode a vin picture on the zxing site that I can't decode with the job demo webiste.

ag

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/EddieLa/JOB/issues/28#issuecomment-77932686.

Anne Gunn, Founder Sheridan Programmers Guild 307 673 5234

eagunn commented 9 years ago

Well, a quick testing of the online demo of quagga did not prove promising. And my coding partner had good luck with a similar test of JOB, so we're going with JOB for VIN barcodes for now. Will report problems if found.

eagunn commented 9 years ago

FWIW, our experience is that this implementation is capable of decoding Code 39 barcodes but only if the picture is crystal clear. Which means that, most of the time so far, for most of our devices, the barcode is not getting decoded. Even the online zebra crossing app (http://zxing.org/w/decode.jspx) can't decode all of the photos we've tried but, definitely, it CAN decode some photos this implementation cannot. If I get any more intuition on what's going wrong, I'll update.

eagunn commented 9 years ago

I haven't determined what's wrong, if anything, with the JOB decoding for VIN (Code 39) barcodes but I have come up with a fallback that we might have to implement if the client finds our JOB-based decoding just doesn't work out in the field.

On Android (I've tested and seen this work from an href tag on my own web page) and iOs (documented), if you have the zebra crossing barcode app installed, a web page can shell out to the app with a 'url' that invokes the barcode. In that url, the web page can specify a return url for the app to come back to with the value of the barcode embedded. Feature is documented here: https://github.com/zxing/zxing/wiki/Scanning-From-Web-Pages

This only took a few minutes to code up and test. Then, for the particular pesky barcode I have in my own vehicle, I found even the zebra crossing app had a hard time decoding it until I turned on the flash. (Bright sunshine and shadow here today.)

Using the app has some cons for us:

The pro is powerful though:

@EddieLa -- I hope you will take this in the spirit it is written. I hope you can continue to develop your library because we would like to continue using it. The in-page, capture picture and value in one click, feature that we've implemented with it is our ideal workflow. We may just have to use the xying app instead or as a fallback till the VIN barcode decoding works better.

EddieLa commented 9 years ago

@eagunn -- No problem, I'm aware of the issues with decoding code39 but haven't had the time to do anything about it since it would require major changes in the decoding algorithm. As for the current situation I don't know if you've looked into it but I would highly recommend testing https://github.com/serratus/quaggaJS I think support for code39 has been added and it's under very active development.

seangates commented 9 years ago

I tried using the QuaggaJS and found that the algorithms used were not sensitive enough, and that the JOB/BarcodeReader here was a much better implementation.

My only feedback is that maybe we can clean up BarcodeReader to make it more accessible. I will try and work on some documentation in the README to help folks overcome the issues.

@eagunn Sounds like you were able to solve your problem with the zxing? Would you use JOB/BarcodeReader if it were better at decoding Code39?