Hello,
I’m using the Isaac gym camera and I want to know how to get the camera’s intrinsic matrix with local_transform?
cam_props = gymapi.CameraProperties() cam_props.width = 1280 cam_props.height = 720 cam_props.horizontal_fov = 60.0 cam_props.enable_tensors = True cam_handle = gym.create_camera_sensor(env, cam_props) local_transform = gymapi.Transform() body_handle = gym.get_actor_rigid_body_handle(env, tiago_handle, 64) gym.attach_camera_to_body(cam_handle, env, body_handle, local_transform, gymapi.FOLLOW_TRANSFORM)
nico-b
2
Hi,
as far as i know isaac gym doesnt provide the camera intrinsics. But i computed them by myself
def compute_camera_intrinsics_matrix(image_width, image_heigth, horizontal_fov, device):
vertical_fov = (image_heigth / image_width * horizontal_fov) * np.pi / 180
horizontal_fov *= np.pi / 180
f_x = (image_width / 2.0) / np.tan(horizontal_fov / 2.0)
f_y = (image_heigth / 2.0) / np.tan(vertical_fov / 2.0)
K = torch.tensor([[f_x, 0.0, image_width / 2.0], [0.0, f_y, image_heigth / 2.0], [0.0, 0.0, 1.0]], device=device, dtype=torch.float)
return K
i compute this matrix one time at the creation of the environment and use it throughout the training, transforming depth images and to point clouds.
2 Likes
Hi,
thanks for your help. It’s very helpful to me.
Best regards,
xiaolin
system
Closed
4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.