Archive for the ‘Techie Corner’ Category
Using Zebra for batch processing
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.
Cataloguing my home library
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.

123a.org relaunched
Some time back, I had to remove the old 123Avatar site because my webhost no longer allowed me to use PHP’s exec() or system() functions, which was required to use ImageMagick. Instead of rewriting the site to use the gd functions, I decided to relaunch 123a.org as an image hosting service.
The site is based on Mihalism Multi Host, but with several modifications. The first allows me to track image views (the original version linked directly to the image files). This allows me to collect stats on the views as well as to implement some bandwidth controls or anti-abuse blocking in future. The second is to make use of Apache’s URL rewriting to generate nice URLs.
Yes, there are hundreds of free image hosts available now: Imageshack and Photobucket being the more popular ones. So there’s really no particular reason to use mine. But, hey, just give it a shot if you like.
The LAMP Experience
Some months back, I was on the lookout for a cheap NAS (network attached storage). The idea was that it would be cheaper than buying a second system, and if I used a NAS instead of just adding a hard disk to my PC, I should be able to switch off my PC sometimes, and not worry about shared files being inaccessible. Plus, I just wanted to play with a new gadget.
I had two choices at that time: Planex NAS-01G or Kuro-Box (a.k.a. Kurobox, KuroBox, Kuro Box…). The Kuro-Box was about SGD40 more expensive, but it was essentially a Linux box, and highly “hackable”. The Planex NAS-01G is also a Linux box, but it is meant to work out-of-the-box, and has limited “hack-ability”.
Making the most out of non-HDTV Wii
My Nintendo Wii is connected to my TV tuner on my PC. This means I get to play my Wii in my room, on my 19″ LCD monitor. The TV tuner isn’t a HDTV one, so it only has composite (RCA) and S-Video inputs. Nintendo only bundles composite video cables, and initially, only sold component (HDTV) cables. Over the past months, third-party S-Video cables appeared.
I got hold of an S-Video cable today, and am pleased to report that there is quite an improvement in image quality over the composite cable. Of course, it won’t be HDTV-quality (which, by the way, is only 480p on the Wii), but it’s an improvement nonetheless. And, at SGD20 (~USD13), is much cheaper than buying a HDTV tuner or HDTV.
Click here to compare the image quality of composite versus S-Video cable on the Wii.