Magic Decoding of UPC Codes on Books

Let me briefly sing the praises of the amazing bit open source of code that is Zebra Barcode Reader. Using the zebraimg application that’s included with the source code, I can take a JPEG image of a UPC code on the back of a and get the book’s ISBN returned to me as text.

I’ve managed to assemble the pieces of a puzzle that lets me take a photo of a book’s UPC code, email it to my server, and receive back, a few seconds later, the best prices for new and used copies of the book. It all seems, well, rather magical when it works. And the barcode decoding part of the process seems to work very, very well — 100% so far, in fact.

This was all induced by this 43 Folders blog post about iPhone applications that don’t exist — I reasoned that, as the Nokia N95 has an excellent macro mode for taking close-ups with its 5MP camera, it would also be very good at taking barcode photos with enough resolution to easily decode. And it does.

Here’s how the process works. First, I take a photo with the N95’s camera, using the macro mode and holding the camera about 6 inches above the UPC code:

07172008016 - Share on Ovi

Next, I email the photo, using the N95’s built in mail application and its wifi connection, to a special email address I’ve set up on my server. There’s a script on the server that intercepts the incoming email, pulls the JPEG image’s MIME attachment out of the message, runs the image through zebraimg to get the UPC code, and then uses the API ItemLookup operation to find the title, author and prices for the book. These are then simply emailed back to the sending address:

Results of my Email an UPC Script


Roland Tanglao's picture
Roland Tanglao on July 18, 2008 - 00:33 Permalink

are you going to offer this as a public web service?
i’d love to try this, email me, and i can be user#2! (i’d be emailing from ShoZu coz the Nokia email client is horrid!)

Peter Rukavina's picture
Peter Rukavina on July 18, 2008 - 02:14 Permalink

Still debugging, but once it’s working well(er), I’ll spread it around.

Olle Jonsson's picture
Olle Jonsson on July 18, 2008 - 09:06 Permalink

Great work! Nudge me on IM if you want more eyes on the code.

rc's picture
rc on July 18, 2008 - 17:50 Permalink

Google’s Android Developer challenger also brought up a similar app.

Android Scan:

Use your phone’s camera to capture the barcode and off you go. Pretty interesting, should be good to see other applications