Skip to content

About the Predicted Camera Parameters and Orthographic Projection #24

@ChenZhang-2000

Description

@ChenZhang-2000

Usually, the camera parameters for a camera model should consist of f, c, R, and t, and they have 1, 2, 3 (rotation angle), 3 parameters.
Even if we use the camera coordinate only instead of the world coordinate, the formula still requires f and c. In this case, the projected 2d points p2 of 3d points p3 should be with formula
$$p_2 = f\cdot(p_3[:2]/p_3[2] - c)$$
And I found that the code in this repo for orthographic projection is:

def orthographic_projection(X, camera):
    """Perform orthographic projection of 3D points X using the camera parameters
    Args:
        X: size = [B, N, 3]
        camera: size = [B, 3]
    Returns:
        Projected 2D points -- size = [B, N, 2]
    """ 
    camera = camera.view(-1, 1, 3)
    X_trans = X[:, :, :2] + camera[:, :, 1:]
    shape = X_trans.shape
    X_2d = (camera[:, :, 0] * X_trans.view(shape[0], -1)).view(shape)
    return X_2d

The 3d points wasn't devided by its value on z axis, which would result a orthogonal projection instead of orthomal projection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions