Under the Bridge

Bar coding followup

Couple followups for you on our post yesterday about resources for bar code parsing on the iPhone:

First off, web guru extraordinaire Leif Jason points out that the macro vision problem with one’s iPhone has, in fact, been solved!

Slide the Clarifi lens into place over the built-in lens of your iPhone. Your macro and close-up shots are instantly finer in detail, more accurate in color. With Clarifi’s lens, your iPhone can image an entire business card with astounding clarity. Slide the lens aside for normal photography. WIthout Clarifi, iPhone requires about 18 inches to focus properly. Slide Clarifi’s lens into place and you can move in to 4 inches for crisp detail and great pictures.

A useful accessory, indeed. Buy yours now!

Next, another code tip from authoress Erica Sadun — yes, that’s twice in a week, which is probably a good indication that we should get around to checking out her well-received iPhone Developer’s Cookbook Real Soon Now — a treatise on how to do full screen image preview and grab the image directly.

I’m not big on the whole Image Picker Camera interface. I hate how slow it is and how it prevents you from scraping the screen. So here’s my work around. In the following code, I scan down the UIImagePicker presentation to find my way to the actual preview window.

First, I build my camera controller…

Next, I add a delayed call to tell the image picker to update itself. This allows time for the image picker to load before I start messing with its views…

The update adds a bar button item to the navigation bar and removes the overlay leaving just the preview displayed…

This allows me to snap a copy of the screen as desired. 

This would make the process of providing images to your recognition code much more conveniently straightforward to the user than relying on conventional APIs for taking individual images; and it fits much better with the workflow of actually scanning something to have a full screen preview that goes away by itself when a usable image is found.

There you go — we’ve sorted out ways to address pretty much all the obvious roadblocks to putting together a bar code reading iPhone application. Now, anybody have any good ideas what to do with one?

2
  • Pingback: bar coding followup » iPhone Tricks

  • http://www.airsource.co.uk Ben Blaukopf

    The workflow is great – but the API used to grab the image – UIGetScreenImage() is not part of the iPhone SDK, which means the problem is not quite solved.