curobo.geom.cv module

Computer Vision functions, including projection between depth and pointclouds.

project_depth_to_pointcloud(
depth_image: Tensor,
intrinsics_matrix: Tensor,
) Tensor

Projects depth image to point cloud.

Parameters:

depth_image – torch tensor of shape (b, h, w). intrinsics array: torch tensor for intrinsics matrix of shape (b, 3, 3).

Returns:

torch tensor of shape (b, h, w, 3)

get_projection_rays(
height: int,
width: int,
intrinsics_matrix: Tensor,
depth_to_meter: float = 0.001,
) Tensor

Get projection rays for a image size and batch of intrinsics matrices.

Parameters:
  • height – Height of the images.

  • width – Width of the images.

  • intrinsics_matrix – Batch of intrinsics matrices of shape (b, 3, 3).

  • depth_to_meter – Scaling factor to convert depth to meters.

Returns:

Projection rays of shape (b, height * width, 3).

Return type:

torch.Tensor

project_pointcloud_to_depth(
pointcloud: Tensor,
output_image: Tensor,
) Tensor

Projects pointcloud to depth image based on indices.

Parameters:
  • pointcloud – PointCloud of shape (b, h, w, 3).

  • output_image – Image of shape (b, h, w).

Returns:

Depth image of shape (b, h, w).

Return type:

torch.Tensor

project_depth_using_rays(
depth_image: Tensor,
rays: Tensor,
filter_origin: bool = False,
depth_threshold: float = 0.01,
) Tensor

Project depth image to pointcloud using projection rays.

Projection rays can be calculated using get_projection_rays function.

Parameters:
  • depth_image – Dpepth image of shape (b, h, w).

  • rays – Projection rays of shape (b, h * w, 3).

  • filter_origin – Remove points with depth less than depth_threshold.

  • depth_threshold – Threshold to filter points.

Returns:

Pointcloud of shape (b, h * w, 3).