Jeff-sjtu / HybrIK

Official code of "HybrIK: A Hybrid Analytical-Neural Inverse Kinematics Solution for 3D Human Pose and Shape Estimation", CVPR 2021
MIT License
1.17k stars 142 forks source link

Some quetions about the details of 'def batch_get_pelvis_orient_svd'. #122

Closed sean-001 closed 1 year ago

sean-001 commented 1 year ago

Hi, thanks for your codes!

I get some puzzles about the implemention of get the global root rotation R0 using SVD.

# rot_mat_non_zero = torch.bmm(V, U.transpose(1, 2))
det_u_v = torch.det(torch.bmm(V, U.transpose(1, 2)))
det_modify_mat = torch.eye(3, device=U.device).unsqueeze(0).expand(U.shape[0], -1, -1).clone()
det_modify_mat[:, 2, 2] = det_u_v
rot_mat_non_zero = torch.bmm(torch.bmm(V, det_modify_mat), U.transpose(1, 2))

What is the det_modify_mat and why should we use det_modify_mat instead of rot_mat_non_zero?

flybigpig1999 commented 1 year ago

this problem may be can solved in this paper 《Least-Squares Fitting of Two 3-D Point Sets》,det_modify_mat is the factor that make the results of SVD correct in the one condition of calculation,and the result may be wrong in some conditon if not use det_modify_mat .

sean-001 commented 1 year ago

this problem may be can solved in this paper 《Least-Squares Fitting of Two 3-D Point Sets》,det_modify_mat is the factor that make the results of SVD correct in the one condition of calculation,and the result may be wrong in some conditon if not use det_modify_mat .

Oh, thanks for your reply !