Perspective Camera¶
- project_points(point_3d, camera_matrix)[source]¶
Projects a 3d point onto the 2d camera plane.
- Parameters
point3d – tensor containing the 3d points to be projected to the camera plane. The shape of the tensor can be \((*, 3)\).
camera_matrix (
Tensor
) – tensor containing the intrinsics camera matrix. The tensor shape must be \((*, 3, 3)\).
- Return type
- Returns
tensor of (u, v) cam coordinates with shape \((*, 2)\).
- unproject_points(point_2d, depth, camera_matrix, normalize=False)[source]¶
Unprojects a 2d point in 3d.
Transform coordinates in the pixel frame to the camera frame.
- Parameters
point2d – tensor containing the 2d to be projected to world coordinates. The shape of the tensor can be \((*, 2)\).
depth (
Tensor
) – tensor containing the depth value of each 2d points. The tensor shape must be equal to point2d \((*, 1)\).camera_matrix (
Tensor
) – tensor containing the intrinsics camera matrix. The tensor shape must be \((*, 3, 3)\).normalize (
bool
, optional) – whether to normalize the pointcloud. This must be set to True when the depth is represented as the Euclidean ray length from the camera position. Default:False
- Return type
- Returns
tensor of (x, y, z) world coordinates with shape \((*, 3)\).