point_clouds
Point-cloud processing and visualization utilities.
- robotblockset.cameras.point_clouds.transform_points(homogeneous_transform_matrix: ndarray, points: ndarray) ndarray[source]
Applies a transform to a (set of) point(s).
- Parameters:
homogeneous_transform_matrix (HomogeneousMatrixType) – _description_
points (PointsType) – _description_
- Returns:
PointsType
- Return type:
(3,) vector or (N,3) matrix.
- robotblockset.cameras.point_clouds.filter_point_cloud(point_cloud: PointCloud, mask: Any) PointCloud[source]
Filter a point cloud by a mask.
- Parameters:
point_cloud (PointCloud) – Point cloud to filter.
mask (Any) – Mask used to index the point cloud arrays.
- Returns:
Filtered point cloud.
- Return type:
- robotblockset.cameras.point_clouds.generate_point_cloud_crop_mask(point_cloud: PointCloud, bounding_box: Tuple[Tuple[float, float, float], Tuple[float, float, float]]) ndarray[source]
Build a point-cloud crop mask.
- Parameters:
point_cloud (PointCloud) – Point cloud to crop.
bounding_box (BoundingBox3DType) – Bounding box that surrounds the points to keep.
- Returns:
Mask that can be used to filter the point cloud.
- Return type:
np.ndarray
- robotblockset.cameras.point_clouds.crop_point_cloud(point_cloud: PointCloud, bounding_box: Tuple[Tuple[float, float, float], Tuple[float, float, float]]) PointCloud[source]
Crop a point cloud to a bounding box.
- Parameters:
point_cloud (PointCloud) – Point cloud to crop.
bounding_box (BoundingBox3DType) – Bounding box that surrounds the points to keep.
- Returns:
Cropped point cloud.
- Return type:
- robotblockset.cameras.point_clouds.transform_point_cloud(point_cloud: PointCloud, frame_transformation: ndarray) PointCloud[source]
Transform a point cloud to another frame.
- Parameters:
point_cloud (PointCloud) – Point cloud to transform.
frame_transformation (HomogeneousMatrixType) – Transformation matrix from the current frame to the target frame.
- Returns:
Transformed point cloud.
- Return type:
- robotblockset.cameras.point_clouds.point_cloud_to_open3d(point_cloud: PointCloud) Any[source]
Convert a PointCloud to an Open3D tensor point cloud.
- Parameters:
point_cloud (PointCloud) – Point cloud to convert.
- Returns:
Open3D tensor point cloud.
- Return type:
Any
- robotblockset.cameras.point_clouds.open3d_to_point_cloud(pcd: Any) PointCloud[source]
Convert an Open3D point cloud to PointCloud.
- Parameters:
pcd (Any) – Open3D tensor point cloud.
- Returns:
Converted point cloud dataclass.
- Return type:
- robotblockset.cameras.point_clouds.open3d_point(position: ndarray, color: Tuple[float, float, float], radius: float = 0.01) Any[source]
Creates a small sphere mesh for visualization in open3d.
- Parameters:
position (Vector3DType) – 3D position of the point
color (Tuple[float, float, float]) – RGB color of the point as 0-1 floats
radius (float, optional) – radius of the sphere
- Returns:
sphere
- Return type:
an open3d mesh
Functions
|
Crop a point cloud to a bounding box. |
|
Filter a point cloud by a mask. |
|
Build a point-cloud crop mask. |
|
Creates a small sphere mesh for visualization in open3d. |
Convert an Open3D point cloud to PointCloud. |
|
|
Convert a PointCloud to an Open3D tensor point cloud. |
|
Transform a point cloud to another frame. |
|
Applies a transform to a (set of) point(s). |