after reading Tom Igoe’s “Making things talk” I got interested in what you can do with a standard webcam in terms of motion/position detection.
Remembering Johnny Lee’s amazing work about IR-tracking with a wiimote (http://johnnylee.net/projects/wii/i tried to do something similar in Processing (as interfacing with Arduino is so easy).
I tried using the JMyron library, which didn’t work for me (as it only uses the standard video source, which is my video capture card, and I didn’t want to disable it…), so I spent two days in Processing to come up with my own little sketch:
It contains a raw version which is quite slow, called “IR_tracking_work_try_some_sorting_5” where you can see the single processes in action.
There is also a more finished version, which works quite fast, called “IR_tracking_v_1”.
Both versions are there as Processing-Sketches, Windows-, Mac- and Linux-executables (only Windows tested).
To prepare my webcam, I built a filter from old 35mm-film:
Cut to pieces (big enough to cover the lens) it looks like this:
If you layer them, you can see how the film blocks visible light, but lets IR-light pass through (no filter, 1-6 layers):
Tape the layers together and tape them in front of your lens.
Shoot a tree (here only 3 layers of film):
Build, download and have fun!