Head tracking for Spring
Posted: 03 Feb 2008, 17:43
I am working on a head tracking application that uses any webcam, which is placed above the monitor to recognize the players head. It then uses this information to track the camera in relation to the players head.
As of yet, the recognition is done by a Haar classifier, and it uses the OpenCV framework.
It adds the recognition information to a file, which is then read by a lua script in real time. The widget sets the camera to the corresponding position.
Moving your head left and right moves the camera left and right (just like scrolling in OTA mode), and up and down motion is mapped to tilting the camera (ctrl+scrollwheel in OTA view)
The app adds a great deal of realism to spring, but so far i have quite a few issues with it:
The Haar classification isn't too accurate, so that still needs a lot of tweaking.
Most webcams frame rate drops to about 5 fps when used with ambient lighting, the ideal frame rate, which is about 15 minimum, needs stronger ambient lighting.
Its quite CPU intensive, but I don't see this to be a problem on dual core machines. Any dual core pc should be able to handle it without a drop in spring frame rate.
Though the biggest issue so far is with Lua's Spring.SetCameraState function. It uses an exponential decay when moving the camera to a position. I would need a linear motion to make the movement less jerky.
So far there is only support for windows, as I have no experience with other platforms.
I'm wondering wether the community would like to try this app? If so, I can probably upload it.
Is there any interest in adding this feature to spring?
Thanks for your attention,
Beherith
As of yet, the recognition is done by a Haar classifier, and it uses the OpenCV framework.
It adds the recognition information to a file, which is then read by a lua script in real time. The widget sets the camera to the corresponding position.
Moving your head left and right moves the camera left and right (just like scrolling in OTA mode), and up and down motion is mapped to tilting the camera (ctrl+scrollwheel in OTA view)
The app adds a great deal of realism to spring, but so far i have quite a few issues with it:
The Haar classification isn't too accurate, so that still needs a lot of tweaking.
Most webcams frame rate drops to about 5 fps when used with ambient lighting, the ideal frame rate, which is about 15 minimum, needs stronger ambient lighting.
Its quite CPU intensive, but I don't see this to be a problem on dual core machines. Any dual core pc should be able to handle it without a drop in spring frame rate.
Though the biggest issue so far is with Lua's Spring.SetCameraState function. It uses an exponential decay when moving the camera to a position. I would need a linear motion to make the movement less jerky.
So far there is only support for windows, as I have no experience with other platforms.
I'm wondering wether the community would like to try this app? If so, I can probably upload it.
Is there any interest in adding this feature to spring?
Thanks for your attention,
Beherith