Hacker News new | ask | show | jobs
by tubelite 4231 days ago
This is great news.

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?

2 comments

I've had similar issues on Google Glass, which has no auto-focus. Commercial libraries like Scandit and even the paid app by the zxing author have better support for blurry images and are able to handle, for example pixels which are partially white/black instead of trying to bin everything into on or off, but the open source version lacks this capability. So sometimes it is possible to do without good focus if you have a better algorithm.
I'm still facing the same problems with the missing autofocus. For some devices it works out of the box, like the HTC one mini, but for the most it does not. There is actually an open issue about that in the Chrome-Browser for Android (https://code.google.com/p/chromium/issues/detail?id=343894)

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.