last night was proper geek time for me. last year i hacked together an old webcam and a 35mm lens cap so that i could attach a second-hand zoom lens to the webcam. it kind of worked but the pictures were weird (see my little profile icon here) and it was hard to use.
well, now i’ve found a use for it – as a barcode scanner!
i’ve got another webcam but it can’t produce a big enough image of a normal barcode. my zoom lens cam works well. mind you, the webcam isn’t great quality and the lens is old and dirty and i’ve not looked after either whilst sticking them together or since, so the pictures are a bit iffy.
so, i found zebra – a bit of FOSS software that can scan in barcodes. had to install a few devel packages on fedora 8 to get it to compile. then i had to modify the code to get it to talk to the second webcam, not the first.
it still refused – turns out the webcam only supports GREY or YUV420p formats but the code only supports RGB24. a quick bit of googling and wikipediaing and coding and we had it accepting YUV420p and reading the black and white data correctly. … and barcodes appeared!!
another fix was required to the zebra scanner so that it includes the check digit in its output – the searches didn’t work without it.
the next nice find on the net was barcodepedia. loverly. great idea. didn’t have many of the DVDs i scanned. plus it looks like i might have broken it by pestering it with searches. sorry about that.
5022366552943 – Ghost in the Shell [Region 2] on Barcodepedia.com
5023965343321 – Katakuri-ke no kôfuku on Barcodepedia.com
5023965347428 – Mou gaan dou on Barcodepedia.com
5023965350220 on Barcodepedia.com
5023965351227 on Barcodepedia.com
however, it did know about manufacturer codes, so even if it doesn’t know what DVD it is you can still find out who made it.
whilst looking at these extra details and trying it out on a book i saw that the barcode is actually the ISBN number. so i googled for an online ISBN search and was reminded to look at amazon.
and that made me think of just passing the barcode values to amazon in the first place – which works!
a little bit of scripting later and i can now point books and DVDs at my hacked up webcam and the titles from amazon pop up on the screen. 🙂
Tenchi Muyo! DVD Ultimate Collection (NTSC)
Wario Ware: Smooth Moves (Wii)
Azumanga Daioh – Vol. 1
Azumanga Daioh – Vol. 2
My Wrongs #8245-8249 & 117 
At The Height Of Summer 
Ghost in the Shell: Stand Alone Complex – Solid State
Ghost In The Shell 
The Happiness Of The Katakuris 
Infernal Affairs 
The Hitchhikers Guide to the Galaxy (2 Disc Edition) 
next up – get more details from amazon and/or barcodepedia and save them to a CSV or XML file that gcstar can read.