TadasBaltrusaitis / OpenFace

OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.
Other
6.86k stars 1.84k forks source link

FaceLandmarkImg output #966

Open johnbone25 opened 3 years ago

johnbone25 commented 3 years ago

from the openface output values (in the csv) how do you detect if the person is looking up, down, right or left? Thank you.

For example, from this values or gaze_angle values: image

johnbone25 commented 3 years ago

i obtained this values (namely gaze_angle, pose_T and so on) but how can i use them to understand if looking right, left, down or up? What are the intervals to determine if person looks right, left, up or down?

AndyIMac commented 3 years ago

Hi johnbone25. Have a look at the documentation for the output format here. Short summary is that the pose_Tx,y,z is the information about where the head is positioned, and the pose_Rx,y,z stuff is about the rotation about the x, y, and z axes. The system Openface uses is that the x-axis is left to right, the y is up and down, and the z is towards and away from the camera. If they tip their head up, you'll get a negative pose_Rx. If they turn to their right, you'll get a positive pose_Ry. I think that's the right direction. But the best way to test it is just to turn on your webcam and try it yourself and plot the output.

Oh, and the angles are measured in radians.

johnbone25 commented 3 years ago

@AndyIMac so, pose_Ry is positive when they turn to their right, instead it is negative when they turn to their left? And pose_Rz is not important? As well as pose_Tx, y, z?

AndyIMac commented 3 years ago

I can't remember exactly, but I think it's that someone turning to their right (the camera's left) will give positive pose_Ry, and turning to their left (camera's right) make it negative. If they tilt their head down, pose_Rx is positive. Tipping their head up makes pose_Rx negative. pose_Rz is if they tip or roll their head from side to side, so their nose points the same direction, but their ears would be at different heights. Whether that is "important" or not depends on what you want to do. But it's not quite as simple as yaw, pitch, and roll (what you call the 3 rotations of the head). The data from openface is in world coordinates. Whether you need to to some kind of conversion is something you might have to work out yourself. I suggest looking up rotation formalisms.

The pose_T... values relate to head translation, sliding right/left, down/up, back/forwards (measured in mm), but not turning. You can think of the pose_Tx and pose_Ty as being where the head is on the screen. Again, whether they are important is up to you!

On Tue, 4 May 2021, 19:19 johnbone25, @.***> wrote:

@AndyIMac https://github.com/AndyIMac so, pose_Ry is positive when they turn to their right, instead it is negative when they turn to their left? And pose_Rz is not important? As well as pose_Tx, y, z?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TadasBaltrusaitis/OpenFace/issues/966#issuecomment-832146634, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATP2W6GRTUCT2J2FDOLKZRLTMA3ELANCNFSM44BI7HAQ .

johnbone25 commented 3 years ago

ok, thanks. Basically, I'm interested in knowing if the person is looking straight, left, right, up or down

johnbone25 commented 3 years ago

@AndyIMac but these values in the image below, which CSV values exactly correspond to? Thanks so much image

AndyIMac commented 3 years ago

The orientation values are pose_Rx, pose_Ry, and pose_Rz, except in radians. The Pose values are pose_Tx, pose_Ty, and pose_Tz. The Gaze values are gaze_angle_x and gaze_angle_y, except in radians. Again, the order of how they connect is that turn (left/right) is Ry often called yaw, up/down is Rx often called pitch, and tilt is Rz often called roll. If you want to check it better yourself, record a video of you turning slowly from side to side, then nodding slowly up and down, then tipping your head from side to side. Plot the 3 pose_R... values in the CSV and see what order they come in.

"I hear and I forget. I see and I remember. I do and I understand."

TadasBaltrusaitis commented 3 years ago

You have to specify gaze to be output if you want to get gaze values. Check out this wiki page - https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments

You will need to add a -gaze flag if you want gaze to be output