jgiam.com

Just another WordPress weblog

Archive for January, 2009

Using Zebra for batch processing

without comments

As mentioned in my previous post, Zebra, more specifically, zebraimg, the barcode recognition component, is fast and rather accurate. However, the program isn’t really made for batch processing of barcodes. Yes, you can execute zebraimg *.jpg, but the problem is that it is difficult to extract information on which barcodes were successfully recognised, which were ambiguous, and which failed. I initially ran this command to process my barcodes, but ended up having to cross-check the results, which wasted quite a bit of time. I wanted some formatting of results to make it easier to identify problematic barcodes.

A simple script would be able to format the recognition results. Because I am not familiar with shell scripting, I wrote one in PHP instead.

The gist of the script is that it scans the working directory for all JPEGs, runs zebraimg and writes the result to a file. The result is saved in a CSV format with the filename and zero or more recognised barcodes.

Read the rest of this entry »

Written by Jon G

January 13th, 2009 at 4:10 pm

Posted in Techie Corner

Tagged with

Visit to the Singapore Zoo

without comments

Before my next post on zebraimg, how about some actual zebras? :)

This was from my visit to the Singapore Zoo in December. Do check out the rest of the album here, or my dA for selected photos.

Written by Jon G

January 10th, 2009 at 8:18 pm

Posted in Photography

Tagged with

Cataloguing my home library

without comments

I have many books at home, and I’ve always wanted to keep a catalogue of my books. But because I have so many books, manually typing in ISBNs was out of the question. I wanted a tech solution, preferably free. I explored the possibility of software to recognise barcodes from photos, since it would be easy to snap photos of barcodes of my books.

Being a Windows person, I searched for and tried Windows programs first. The only candidate I found was bcTester. It recognised the first photo, then choked on the second. I tried cropping that, and it recognised it, but then choked on the third. To make it easier, I adjusted my photos to increase the contrast (easily done in batch), but cropping each photo individually would defeat the whole purpose of my “exercise”, and bcTester did not support batch processing either, so I decided to pass.

The next program I tried was Zebra, a *nix open-source project. I spent some time getting the pre-requisites installed, including messing around with some symbolic links, before I managed to successfully compile and run zebraimg. Once I did, zebraimg was just amazing. It zipped through my barcode images and got most correct.

barcodes

Read the rest of this entry »

Written by Jon G

January 9th, 2009 at 11:02 pm

Posted in Techie Corner