Skip to content

camera.py

rerun.log.camera

def log_pinhole(entity_path, *, child_from_parent, width, height, timeless=False)

Log a perspective camera model.

This logs the pinhole model that projects points from the parent (camera) space to this space (image) such that:

point_image_hom = child_from_parent * point_cam
point_image = point_image_hom[:,1] / point_image_hom[2]

Where point_image_hom is the projected point in the image space expressed in homogeneous coordinates.

Example
width = 640
height = 480
u_cen = width / 2
v_cen = height / 2
f_len = (height * width) ** 0.5

rerun.log_pinhole("world/camera/image",
                  child_from_parent = [[f_len, 0,     u_cen],
                                       [0,     f_len, v_cen],
                                       [0,     0,     1  ]],
                  width = width,
                  height = height)

Parameters:

Name Type Description Default
entity_path str

Path to the child (image) space in the space hierarchy.

required
child_from_parent npt.ArrayLike

Row-major intrinsics matrix for projecting from camera space to image space.

required
width int

Width of the image in pixels.

required
height int

Height of the image in pixels.

required
timeless bool

If true, the camera will be timeless (default: False).

False