-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hi! Thanks for providing such a great work.
I have met some problems understanding the fit_ortho_param function:
def fit_ortho_param(joints3d: np.ndarray, joints2d: np.ndarray) -> np.ndarray:
joints3d_xy = joints3d[:, :2] # (21, 2)
joints3d_xy = joints3d_xy.reshape(-1)[:, np.newaxis]
joints2d = joints2d.reshape(-1)[:, np.newaxis]
pad2 = np.array(range(joints2d.shape[0]))
pad2 = (pad2 % 2)[:, np.newaxis]
pad1 = 1 - pad2
jM = np.concatenate([joints3d_xy, pad1, pad2], axis=1) # (42, 3)
jMT = jM.transpose() # (3, 42)
jMTjM = np.matmul(jMT, jM)
jMTb = np.matmul(jMT, joints2d)
ortho_param = np.matmul(np.linalg.inv(jMTjM), jMTb)
ortho_param = ortho_param.reshape(-1)
return ortho_param # [f, tx, ty]
Do the f in [f, tx, ty] means the focal_length and the tx, ty in [f, tx, ty] means the principal_point ?
Because I want to use pytorch3D to perform mesh rendering, I am thinking which pytorch3D camera is suitable here. I guess pytorch3d.renderer.cameras.OrthographicCameras is suitable since DART only provide orthographic camera params and it requires focal length and principal_point.
Thank you!
Metadata
Metadata
Assignees
Labels
No labels