if you have an example un-rotated face you can use camshift to determine the face orientation.
but in general, the easiest solution is to rotate your image for each orientation you want to check, in 10-15 degree intervals. that’s what we did for ‘the portrait machine’:
i’ve just uploaded an addon i’ve been using lately, is based on the MPT library which could also be used to detect smiles and blinks although that code is not there yet. Anyway, i’m using the position of the eyes to calculate the rotation of the face, although it’s a little slower than haar cascade.
The face size is a little unstable, there’s some super simple filtering code inside the class but it’s commented cause in the end i’ve used some kalman filters from outside the addon.