Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About plot_3axis_Zaxis #29

Open
Mt-Taka0129 opened this issue Oct 23, 2023 · 1 comment
Open

About plot_3axis_Zaxis #29

Mt-Taka0129 opened this issue Oct 23, 2023 · 1 comment

Comments

@Mt-Taka0129
Copy link

Hello, I have questions about demos/image.py.

def plot_3axis_Zaxis(img, yaw, pitch, roll, tdx=None, tdy=None, size=50., limited=True, thickness=2):
    # Input is a cv2 image
    # pose_params: (pitch, yaw, roll, tdx, tdy)
    # Where (tdx, tdy) is the translation of the face.
    # For pose we have [pitch yaw roll tdx tdy tdz scale_factor]

    p = pitch * np.pi / 180
    y = -(yaw * np.pi / 180)
    r = roll * np.pi / 180

When drawing the three axes, why is only the Yaw angle multiplied by a minus sign?

Also, is the head posture, the output of the neural network, an Eulerian angular representation (z-x-y system) with the camera coordinate system (image below) rotated in the order of Z-axis, Y-axis and X-axis?
image

@hnuzhy
Copy link
Owner

hnuzhy commented Oct 23, 2023

This is adopted from the original implementation of HopeNet and FSA-Net.

Please refer links below:
https://github.com/natanielruiz/deep-head-pose/blob/master/code/utils.py#L51
https://github.com/shamangary/FSA-Net/blob/master/demo/demo_FSANET.py#L18

For the order of three Euler angles, we used the Z-Y-X mode as in 300W-LP and AFLW2000. Actually, I recently found that the inherent drawbacks of Euler angles (e.g., the gimbal lock, and sensitive to rotation order around three axes) can be addressed by the rotation matrix representation. I will turn to it and also suggest you to use it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants