Enhancing Barcode Recognition

The Pedias have been recognizing barcodes from images since back when the external iSight was the hottest new gadget. The code has withstood over the years and being open source has been used in several other projects. However, with the semi-newer Mac Book Pros that not only have a fixed focus iSight but also a lower capture resolution the code was not handling well. (All built in Mac iSights are fixed focus, impressively the iPhone 3GS does have focusing capabilities and hopefully these will make it to the Mac line in the future too).

One of our fellow developers, Chris Karr, decided to improve the situation and spent Christmas building a new recognition engine from the ground up.

His new code is built with the idea of incorporating my old version as well as new solutions in a structure that allows the insertion of different scanners for the same image and then pick from the best results. Chris is using OpenCV, an extensive image processing library, to handle his video and prepare the frames for scanning. I’ve been trying to improve on his results but have had little success in bettering his already impressive work using OpenCV to which I am not accustomed.

My original scanner works directly by accessing the incoming QuickTime buffer and I am no expert on video but working with QuickTime I’ve come to learn its ways as well as the UYVY native format. So I decided to blend the new and the old. I did this by taking some structure ideas from Chris (in order to clean up my code that’s looking a bit messy due to all the optimizations) as well as the new excellent barcode scanning library called ZBar that Chris is using as one of the scanners and keeping my Quicktime capture. With these changes I was able to improve the current version.

The result of all this mixing is for the moment a new impressive scanning engine for the Pedias. In the long run hopefully we’ll be able to bring all these improvements together with Chris’ version of the framework that is better structured for future improvement and make even further advancements. In the meantime if you’re looking for a scanning engine take a look at Zbar as it even has an iPhone project included in the source (the old barcode scanner code has been very popular with users wishing to port it to the iPhone, this new project will save developers a lot of work).

I want to thank both Chris Karr and Jeff Brown, the creator ZBar, for their work in building great tools for the Cocoa community.
Go ahead  and play with the latest Pedias and let us know if the iSight’s even more magical than before (now scans upside down codes as well).


Comments

13 responses to “Enhancing Barcode Recognition”

  1. Unfortunately it works even worse than before. No more red lines flashing green at least sometimes. I use an iMac i5 and found the old version a bit better than with the first iMac 24″. On my MacBook Air the old version works as it should:-).
    With this new green box I could scan no book so far.

  2. On my MBP (15″ late 2007) it works like a charm, very zippy. A big improvement. You should be aware though that DL2 has a new & very fast iSight engine too. I bought it for books as the barcode recognition was faster than yours in the past. I think yours is a bit faster now at least on my computer.

  3. filippo Avatar
    filippo

    unfortunately it doesn’t work on my intel imac (first generation), I took a previously scanned cd and it didn’t get scanned this time. I tried several cds, they just don’t get scanned

  4. Linus Avatar
    Linus

    Whatever “new” technology that is, it has rather impaired the barcode recognition in any of the Pedias. It takes more time and trials to read the barcode compared to its performance before. Bruji, please fix it.

    (MBP 15″ late 2007 on 10.6.3)

  5. Alexander Avatar
    Alexander

    great improvement! working on iMac 27″ i7.

    really saved me buying a scanner which i have just thought of today. thanks!

  6. Alexander Avatar
    Alexander

    PS: just to clarify: i have just three days ago started with the programm, did input some 300 cds and have done another 300 since the new barcode-scanning-version, so i can tell that with MY EQUPIMENT its really a VAST improvement

  7. Detlef Avatar
    Detlef

    Unortunately I don’t see any improvement here. I tried several DVDs, BluRays and books and it was unable to recognize even one of them. Too bad…

    Using early 2008 iMac.

  8. Fred from France Avatar
    Fred from France

    Hi,
    same here, former version and latest just downloaded made scanning impossible !
    I have the scanning windows and the red rectangle, but no scan, whatever I try, whichever book I use …

  9. Robert in Germany Avatar
    Robert in Germany

    This is just not working on my imac – well, I did manage to get one dvd scanned (using isight) after 20 minutes of trying. The previous version was mostly unproblematic. I hope you can fix this enhancement…..

  10. Reinhold from Germany Avatar
    Reinhold from Germany

    isight doesn’t work on my macbook unibody (2009, 10.6.3)
    It worked well with former versions of Bookpedia but now…

  11. Please try the beta versions of the Pedias and send us an email with some more information (your computer model and any info from the Pedias found in the Console log) if that doesn’t fix the iSight scanning for you. Here are the download links for the beta versions: Bookpedia, DVDpedia, CDpedia, Gamepedia.

  12. Fred from France Avatar
    Fred from France

    Just dl the beta of Bookpedia, tried close, far, left, right, everything … the red rectangle flashes green, but nothing !
    My Mac is a 21.5″ brand new …
    Thanks

  13. […] News Because dogs can’t type. « Enhancing Barcode Recognition Wedding Bells […]