Skip to content

Questions about the ortho_param in DARTset_utils.py #11

@delaprada

Description

@delaprada

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions