Friday, June 13, 2008

Being a computer science guy and spending a lot of time on the computer, the past while my arms have been feeling it, and protesting. This got me thinking about alternatives to using a mouse/trackball. I googled "mouse alternatives" and found some interesting products; particularly interesting to me was head tracking. There are some expensive products out there that would probably do the job, but I thought, "hey! I can roll my own setup!" My last semester at UVSC I took a 'digital image processing' class. It was a lot of fun, so I decided maybe I could write a program that does object tracking. I first wanted to poke around and see what free programs were out there, which has lead me into two separate projects:
1. The first is a free windows based app called 'FreeTrack'. It does point tracking based on light emitted from IR LEDs which you attach to your hat or whatever. You modify your webcam by pulling out the IR filter so it actually catches IR light, then you add a visible light filter. The net effect is the webcam is only seeing IR light, so the software then has a much easier time tracking the IR light from the LEDs. So I went to ELFA, got myself some IR LEDs, some resistors, refreshed on the circuit equations I learned in physics, and put together a little IR flashlight that you put up right next to the webcam pointing towards my face. I'm then going to put a little reflective dot on my forehead or something, and voila! for the curious, here are the electronic stats:
3 IR LEDs: 880nM, 150mA max, 25 degree focal range.
1 power supply: outputs 17.25v DC (supposed to be 12V! I had to adjust for this...) 600mA max
4 resistors 60 ohms, .6W max

the equations:

I ended up wiring the LEDs in series, so, prototype1 one went alright, worked, but the resistor was getting really hot! this is normal, and it was under it's max power rating (running at .4W), but I housed my little unit in a mini-DV tape holder, so I thought I should find a way to cool it down. Brilliant me wrapped aluminum foil around the resistor as a heatsink (it was 1am mind you) I plug it in and think..."wow, the LEDs are getting really hot"...pop, pop! the LEDs burned out, and as soon as they did, I realized my mistake. I accidentally created a circuit bypass around the resistor, so I fried the LEDs.

prototype two: bought a resistor with a higher power rating, so it won't run as hot. did much better with the soldering this time, and whipped out my unit in under an hour. It works great, in fact I think it's putting out too much light, but as soon as I finish the webcam I can test better. The only thing my webcam is lacking is the visible light filter. I bought some ISO 100 film for this, which will be a cheap alternative to the filters made of glass.

2. To help roll my own object tracking on Ubuntu, I found opencv; libraries and such for computer vision stuff. After some headache trying to get it to compile and run (it kept telling me the functions were undefined, even though I knew the libraries were installed) I finally figured out that the linker needed the libraries specified with the -l flag, at the end of the linker command line. yeah, it works now, and I can play around with some of the samples they have and start to use the libs.

fun stuff!

1 comment:

Linda said...

Hi Guys!
I am glad you are having fun with that, Dan. What I am is very impressed, that's what. Wow.

Elinor's comments were insightful and sweet. Thanks for taking the time to write them all, both of you.

Love you!