Show HN: QuaggaJS, a barcode scanner written in JavaScript
serratus.github.io
serratus.github.io
I think apps that support scale/rotation should not show [ ] brackets but instead a central red +. Haven't dug deeply into how barcode_locator.js in your repo works but with the expectation that the barcode will be in the middle, you might be able to slightly optimize your code to start the location detection from the middle and expand outwards.
It appears you are breaking the image into smaller 'patches' and looping through those to look for chunks of a barcode. Even if the algorithm is resolution independent, you might be able to exit the loop 50-60% earlier if you detect from the middle and go out in a spiral. In other words, the order in which you iterate the loop can make a difference.
I just wrote a QRcode-reader Django widget to be used on a mobile browser, using the LazarSoft library (https://github.com/LazarSoft/jsqrcode). The library worked great, but the HTML5 bits turned out to be surprisingly painful. Camera selection works differently in different browsers - Android Chrome has an API, Firefox throws up a selection dialog every time. Mobile Chrome doesn't let you emit audio unless it is in the context of a UI interaction (desktop Chrome does!)
Worst of all: poor autofocus. I tried multiple Android devices (Nexus 4, Moto G v2, Nexus 5) and in all cases, autofocus on getUserMedia() worked indifferently or not at all, especially close up. In contrast, native barcode/QRcode reader apps on the same devices did much better, snapping to focus very quickly.
I wonder if you faced something similar?
It would help a lot to get continous autofocus working in the browsers. Especially with barcodes, since their size requires the camera to be really close.
We did a quick mashup of our API and this to create a basic (but functional) mobile PoS using the phone camera as a scanner.
I used Lazarsoft's javascript QR code scanner which worked, but it wasn't very robust since it was a manual port of an early version of zxing. It is pretty easy to compile the c++ branch of zxing v2.3 using emscripten but it is a pain to optimize: https://github.com/fta2012/zxing-emscripten (or demo link: http://fta2012.github.io/zxing-emscripten/).
I assume this could be solved by wrapping the JS library in something like PhoneGap and installing it as a native app?
Maybe consider making a quick FFOS App?
I've build a Firefox OS app [1] that is theoretically enabled to scan barcodes, but it won't work with most devices out there.
I just tried your app and reading QR codes works really well. You are using an emscripten version of ZBar, right?
at the very least, it can be a web-webapp (firefoxOS let's you declare app manifests for online sites)
Fast and accurate under Android/Firefox Mobile, will use it in the coming project.