Flex: Barcode Scanner
So this isn't an original idea, but I'm learning Flex stuff and it was a fun little project. I saw that Mike Shaw of Webqem had done this webcam barcode reading demo, so I thought I'd see how hard it was. It's not as accurate as Mike's, but it's not bad for a few hours work.
I'll eventually put up the source to this component, but I'm still cleaning some stuff up - particularly around the debugging part, I want to make it a separate component rather than being half in the reader and half in the application.
Basically to work well you need good light and the focus on your webcam set right, even then you still need to be pretty patient sometimes! See inside the app for an example, that was a screenshot from a "read" barcode.
Anyway, have a play with the demo. Requires Flash Player 9, and webcam Flash can see. It's designed to decode EAN-13 barcodes - the standard sort of barcode found on products in stores.
I'm still trying some ideas to improve the accuracy - for example the current algorithm only takes a single line of pixels from the middle of the image, might try taking an average of 1/4, 1/2 and 3/4 instead, or something like that - although that might screw things up if the image isn't straight, currently it can cope with a bit of angle. So maybe just 3 lines all next to each other? Maybe I'm totally on the wrong track?
I think the default tolerance of 80 is set right for a well lit barcode (at least in my experience it was). Maybe some sort of dynamic tolerance system? The code seems fast enough to cope with some extra fiddling around to improve accuracy.
Also I think I've tweaked out the Camera component settings as much as possible - full quality, use as much bandwidth as you like, high framerate and high resolution.
Anyway, get back to you in a few days.. :)
Comments are disabled for this entry.