#1976·pytorch3d

Camera Coordinate Conversion Guide

Author: nath-parthaCreated May 7, 2025Updated Nov 1, 2025

❓ 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

python
        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

Source: facebookresearch/pytorch3d