Sorry for my english. I'm trying to code for a final project a Processing game with a moving 3D scenario from player's perspective using a webcam and face detection/tracking. I tested the example code at
http://ubaa.net/shared/processing/opencv/opencv_detect.html with success but when I included the face tracking in the sketch where the OpenGL environment is, the FPS falls down from 40 to 7-8.
I read about using threads to solved this kind of issues, but I'm a newbie programmer and after hours of "test & error" I couldn't hit the nail on the head.
Has anyone done something similar? I paste below what is my incomplete attempt of the "opencv_detect" example implemented with threads. I have no idea how to display the camera image and draw the face rectangles on screen calling the detectFace class.