Skip to content

About the Predicted Camera Parameters and Orthographic Projection #24

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions