So this iPhone walks into a bar … no, wait, it takes a picture of a bar code. And then it proceeds to do something clever with it. That’s a fairly interesting application space, yes? Well, here’s a roundup of resources to help you along with that!
First off, there’s the Zebra Crossing project at Google Code:
ZXing (pronounced “zebra crossing”) is an open-source, multi-format 1D/2D barcode image processing library implemented in Java. Our focus is on using the built-in camera on mobile phones to photograph and decode barcodes on the device, without communicating with a server. We currently have production-quality support for:
- UPC-A and UPC-E
- EAN-8 and EAN-13
- Code 39
- Code 128
- QR Code
We also have experimental support for the DataMatrix format.
Unfortunately, it’s written in Java; however, they do have an iPhone client off the ground, currently supporting QR Code, so there’s something to work with there at least.
Another option is to work from the desktop downwards; the great folks at Bruji who do a variety of ThingPedia applications have freed the source to their barcode scanning engine:
The barcode scanner project, written in Cocoa, is for scanning barcodes on books, DVDs, CDs and video games as well as most other kind of EAN or UPC barcodes. It is part of our programs - DVDpedia, Bookpedia, CDpedia and Gamepedia - and is also used by Books. The code is available for free in the hopes that it’ll be useful to other Mac developers.
And they even offer a $500 bounty if you can improve the code!
Before you get too excited with the possibilities here though, we should note that there is a body of opinion which holds that the optical properties of the iPhone camera will make it challenging to reliably decode ISBN or other 1-dimensional bar codes due to their small feature size, at least unless you attach some kind of macro lens. But hey, if it was easy, anybody could do it, right?:
h/t: iphonesdk!