Watch the video on YouTube.
What it is: The Compiz `headtracking` plugin uses OpenCV to track the three-dimensional location of your head relative to your screen and puts that data into some OpenGL transformations in Compiz to create the illusion that your display has depth.
What you need: You will need a reasonable webcam that is V4L compatible (or in some other way works with OpenCV). You will also need to obtain OpenCV from CVS, as the Ubuntu package (even in Intrepid) lacks many important features the plugin makes use of (note: the libtool script was broken for me, its $echo wasn't set properly). Then you can get the plugin itself. You'll need a recent version of Compiz, preferably from git, but it should compile with Intrepid (I think).
Who made this: The original distortion code is mine and was made for use with a Wiimote. The OpenCV tracking code was added by pingouinfarceur, who it would appear joined the C-F forums solely to post the patches.
How it works: OpenCV is a video processing library that can track objects based on a definition file (which you'll probably want to make for your own face, unless you look like pingouinfarceur). This data is then used with some fancy trig and the OpenGL glFrustrum() function to distort the viewport in which Compiz renders. In order to make the effect visible, windows are also offset based on their z-depth (stacking order).
Looking forward: If we work out the minor glitches, we may get `headtracking` merged into plugins-extra, and it may come standard with 9.04 - we'll see. Personally, I don't even have a camera that works with OpenCV, so working bugs out and extended testing isn't something I can do myself. At the very least, I'll try and get it packaged for Intrepid and put up a PPA later on.
Discuss.
Bookmarks