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

Questions about the ortho_param in DARTset_utils.py #11

Open
delaprada opened this issue May 18, 2023 · 0 comments
Open

Questions about the ortho_param in DARTset_utils.py #11

delaprada opened this issue May 18, 2023 · 0 comments

Comments

@delaprada
Copy link

delaprada commented May 18, 2023

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!

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

1 participant