Closed jerryhouuu closed 6 years ago
Hi @jerryhouuu
Without any print of the returned values it is hard to find the issue. To debug the code you should pass known parameters and see if the returned value is the expected one.
Moreover you can create your own method for the decomposition and pass the projection matrix to it. A nice example is given here, the method is the following:
def rotationMatrixToEulerAngles(proj_matrix):
sy = math.sqrt(R[0,0] * R[0,0] + R[1,0] * R[1,0])
singular = sy < 1e-6
if not singular :
x = math.atan2(R[2,1] , R[2,2])
y = math.atan2(-R[2,0], sy)
z = math.atan2(R[1,0], R[0,0])
else :
x = math.atan2(-R[1,2], R[1,1])
y = math.atan2(-R[2,0], sy)
z = 0
return np.array([x, y, z])
Hello I follow your code(ex_dlib_pnp_head_pose_estimation_video.py) to implementation the pose estimation, I want to get the face pose, range from +90 to -90, like the following picture I use the six landmark and their world coordinate to get pose
But I have some problem, each case(yaw, pitch, row) is correct, for example, In face roll case, roll is true, but, pitch is false. Or, in complex situation, one of three will false. Could u give me some advise? Thanks.