Using the ZBar barcode scanning suite in the browser with WebAssembly
barkeywolf.consulting
barkeywolf.consulting
Ultimately, after much experimentation, the unavoidable conclusion is that the optical scanning solutions are junk. Connecting a crappy $20 HID bluetooth barcode scanner to a phone is so crazily better at scanning a 1D barcode than even the most massaged optical barcode scanning libraries. Industry workers that deal with these barcodes don't even bother with phone camera scanning, it's way too slow and temperamental.
Probably a HID scanner has the advantage of a better spatial (horizontal) resolution?
Has that been a part of your project yet? I ask because I can't easily imagine any situation where the workers would be more efficient or happier using a phone/webcam/etc to do the scannings
Turns out that workers would rather manually key in the last 5 numbers of a barcode to look it up than screw around with a poorly behaved camera. For the current version of the platform, it's either dedicated hardware scanning or manual ID search, the phone scanning wastes everybody's time.
We support both (camera and external), but surprisingly a lot of our customers find the camera good enough. Code 128 is our second-most scanned symbology behind QR.
If there's even slight damage to the barcode, forget the browser scanners, you can scan that thing until the next Olympics and not get a read. HID scanners don't skip a beat.
I'm mainly curious whether position information is provided, and whether or not multiple barcodes can be detected at once. Digging further I see the output is an array and cornerPoints are provided, but i keep feeling like these samples only show 50% of what I want to see.
https://wicg.github.io/shape-detection-api/#barcode-detectio... BarcodeDetector#detect returns a sequence of detected barcodes, so depending on the implementation and input quality it should able to extract multiple barcodes.
https://wicg.github.io/shape-detection-api/#dictdef-detected... each DetectedBarcode has boundingBox/cornerPoints.
We have a web app that does QR scanning for event badges, using a JS library, but it's painfully slow compared to the camera app.
You can run barcode detection at 30fps on a 1080p video using any modern PC, no problem at all.
But high performance industrial barcode scanners have certain features that would be undesirable in any other application. A greyscale-only sensor for maximum sensitivity, jittery autofocus and autoexposure to respond fast when something appears right in front of the lens, autofocus switching attention so everything in view gets a chance at being in focus, built-in illumination to help avoid motion blur, and so on.
So although the software can provide a good framerate, a laptop webcam may still perform worse than a dedicated barcode scanner.
(zbar is a mixture of good and bad - if you want to experience software barcode detection for yourself your phone's app store probably offers 'scandit' which is closed source but performs pretty well)
Webassembly isn't THAT "new and shiny" anymore in 2024 :)