Skip to content

Camera Coordinate Conversion Guide #1976

Open
@nath-partha

Description

@nath-partha


is there a guidebook or tool that helps in converting the parameters of opencv cameras to pytorch3d cameras

pytorch3d.utils.cameras_from_opencv_projection is useful but its for for the PerspectiveCameras class only

im trying to convert for the fisheye cameras

it would help if there was materials detailing what transformations need to be carried out on
{R, T, K}_cv2 to convert to {R,T,K}_p3d

such that
Image

gives a 1:1 correspondance in image rendering and points projection when

        p3d_k = calc_pytorch3d_camera_matrix(intrinsic_matrices)
        p3d_p = calc_pytorch3d_camera_pose(P_batched)
        batched_cameras = FishEyeCameras(
            focal_length=p3d_k[..., 0, 0],
            image_size=torch.tensor([[scaled_height,
                                      scaled_width]]).repeat(batch_size, 1),
            principal_point=p3d_k[..., :2, 2],
            radial_params=torch.tensor([[0]]).repeat(batch_size, 1),
            tangential_params=torch.tensor([[d, e]]).repeat(batch_size, 1),
            thin_prism_params=torch.tensor(
                ((0.0, 0.0, 0.0, 0.0), )).repeat(batch_size, 1),
            R=p3d_p[..., :3, :3],
            T=p3d_p[..., :3, 3],
        )

i would then setup the necessary implementation in the functions used to create p3d_k and p3d_p

open to any other suggestion for handling the parameters transform for this use case.

TIA

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