Head rotation tracking with webcam in Jitter

bias's icon

Hi to all, I'm studying a way to track the head rotation with a simple webcam, my aim is to control Ambisonics' soundfield rotation, to produce realistic binaural ambiences to use as a demo.
I'm fairly new to Jitter, I'm approaching to it, and I'm sure your help in finding the road to walk into will be great!
I installed the cv.jit library, and I can track the head and the eyes so far, even if I can't track the head rotation yet.
I did not experimented very long by now, and I was thinking about workarounds like using the distance from eye to eye (reducing while rotating), but I'm not sure it would be a stable solution, and I'm sure there is a more elegant one instead!
I'm also sure the discussion could be fantastic!
Thanx for your attention.
Bias

Tobias Rosenberger's icon
Max Patch
Copy patch and select New From Clipboard in Max.

you can use this patch as a start...

bias's icon

Sorry for the delay on the reply, I've been around for a while...
Thank you for the patch, I found very interesting how you managed to track the salient points of the face!
Anyway I wanted to find the rotation of the face, not the horizontal/vertical tilt.
Now I'm going to experiment with the point you helped me to discover, but I'm not sure how to use them...
Any suggestion?

bias's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This is my work by now...
I used the distance btw nose and eyes, and the one btw chin and left and right lips.
I obtain two different angles, and I want to choose between the two the most affordable time to time, in order to prevent the errors due to the instability of the track of the points by the cv.jit.track object.
I also want to smooth the results in an effetive way.
What do you think?

selma benramdane's icon

Hello Bias, I wondered if you managed to finish your headtracking + ambisonic projects. Im looking for means to do the exact same thing in Max !
Thanks :)

Diego Quiroz's icon

Hello Bias, I made your head tracker work, is it only for 2D? I'm looking for it to work for elevation as well.

Noah Neumark's icon

Hey Diego and Bias,

Can you share the latest rendition of your headtracking? Were you able to get the full rotation?