Talk:Headtracker
From Olpcaustria
Forget the infrared. Use an FFT to detect motion.
Use either the FFTW library with 3dNow! assembly enabled or the 3dNow! code from ffmpeg.
To cut down the noise and cut down the data, start with raw (Bayer pattern) images. Sum up all 4 elements of the Bayer pattern, without giving any extra weight to green. (if performance is really troublesome, just pick the channel with the lowest noise) Either way, this gives you the 640x480 reduced to 320x240.
Let the user or their assistant pick a small region for the head. I suggest using the game keys. You can use 256x256 reduced to 128x128, or 128x128 reduced to 64x64. Note that FFTW does support sizes that are not powers of two, so the intermediate sizes are available in case you need them. Show just the window, letting the user or assistant steer it around with the game keys. Showing the full camera view (with a box) is too much data to deal with.
Roll off the data near the edges using a cosine function or similar. (Gaussian might work too) This helps reduce the noise you'll get from the fact that your data is not an infinite periodic function. Of course you do the cosine using integer math and a look-up table: newvalue=oldvalue*table[x_position]*table[y_position].
Forget about direct camera-to-screen mapping. Users control speed or acceleration. You place limits on everything (position,speed,acceleration,jerk) so that the user can regain control by simply waiting for the pointer to hit the edge of the screen.

