I’m writing an application that uses face tracking as a means of interaction. The aim of the app is that the user will try to keep an openGL sphere in the air, like if you were playing football and keeping the ball in the air with your head. The tracking works fine and the physics works fine, but its really slow. Does anyone have any suggestions for optimisation? I’m calling the findHaarObjects() function every frame, which is crippling it…should I try threading it?
OpenGL also has the advantage of being able to use hardware acceleration, ie: a graphics card. I don;t know what your setup is, but maybe if you tried your app on someone else’s computer with a simple graphics card, it could make all the difference.
if that doesn’t work, well, it’s hard to say without looking at your source code…
it would also help if you could find out which part of the code is slowing you down? the head tracking? or the combination of head tracking + physics + opengl.
Hi!
Im working on a similar project and i need fast facetracking too. What speedes up is:
if your tracker found a face then do the next search in a neigbour pixel area not whole screen -> so actually if theres nobody to detect my threaded facetracker is running with 7fps, when theres a found face it goes up to 30fps. second thing: use a thread
In addition to putting the face detector on a thread… in your video settings, try manually setting the frame rate to 60 fps (instead of “best”) … I’ve found that if you manually set it, you will get better results than if you just use “best”.
They are not wrapped in OF yet, but I know there is a version of the opencv addon that supports it coming up. (might be in the svn already?).
You can easily just use the functions on the image you get from the getCvImage() function, but remember to set the ROI back when you are done or you’ll get som odd behaviour.