Camera API#

Getting Camera Information#

  • lych cam get_loc <cam_id> Get 3D location of a camera.

    Parameters

    <cam_id>: ID of the camera.

    Returns

    <x> <y> <z>: 3D coordinates of the camera in the scene.

  • lych cam get_rot <cam_id> Get rotation of a camera.

    Parameters

    <cam_id>: ID of the camera.

    Returns

    <p> <y> <r>: Get pitch, yaw, and roll angles of the camera.

  • lych cam get_fov <cam_id> Get field of view of a camera.

    Parameters

    <cam_id>: ID of the camera.

    Returns

    <fov>: Field of view angle in degrees.

  • lych cam get_c2w <cam_id> Get the camera-to-world transformation matrix.

    Parameters

    <cam_id>: ID of the camera.

    Returns

    <16 floats>: 4x4 transformation matrix in row-major order.

  • lych cam set_film_size <cam_id> <width> <height> Set the film size of a camera.

    Parameters

    <cam_id>: ID of the camera; <width>: width of the film in pixels; <height>: height of the film in pixels.

    Returns

    ok if successful, or an error message if failed.

Rendering 2D Data#

lych cam get_lit#

Get 2D lit rendering data of one or multiple cameras.

Examples:

lych cam get_lit 0 /path/to/save
lych cam get_lit 0 npy
lych cam get_lit 0 png
lych cam get_lit 0 1 2 npy

Parameters:

cam_id… : str

IDs of all target cameras, separated by spaces.

path : str

Save path or return format. In single mode: A local path, or keywords npy / png to return data directly. In batch mode: must be npy, which returns data with shape (N, H, W, C), BGRA mode, and np.uint8 dtype.

Returns:

result : str or bytes

Returns ok if successful, or an error message if failed. If keywords npy or png are used, returns the corresponding data stream.