Re:Show HN: QuaggaJS, a barcode scanner written in JavaScript
by lucio on Tuesday November 25, 2014 @09:08AM
(#8657744)
Barcode can be anywhere. It's an impressive work. http://www.oberhofer.co/how-barcode-localization-works-in-qu...
Re:Show HN: QuaggaJS, a barcode scanner written in JavaScript
by klintcho on Tuesday November 25, 2014 @09:16AM
(#8657776)
There are a range of different methods that can be used, but your guess is probably correct regardless of which method you use: "breaking the image into smaller 'patches' and looping through those to look for chunks of a barcode". I would probably train a classifier (SVM or similar) using some rotation invariant feature, such as DAISY or ORB (BRIEF). I tried something similar for CRF image segmentation.
This is mighty impressive in JS whatever method they use, the CV libraries in JS are kind of limited.
Re:Show HN: QuaggaJS, a barcode scanner written in JavaScript
by serratus on Tuesday November 25, 2014 @05:45PM
(#8660229)
Thanks for this interesting input. I don't have much experience with classifiers, nor if they work well in JavaScript. I already implemented FAST and BRIEF in another project, but this solution was neither scale, nor rotation invariant. ORB seems to be a better fit for that. How would you implement your idea in JS?
Re:Show HN: QuaggaJS, a barcode scanner written in JavaScript
by serratus on Tuesday November 25, 2014 @04:55PM
(#8659961)
Thanks for the input, I haven't really thought of that before. But since the barcode is usually in the center of the viewport this makes a lot of sense. I'll give it a try and thanks for adding an improvement issue on GitHub.
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.