Skip to content

Welcome to p3dpy documentation!

FieldBase

Field Base class.

This class defines the fields that are included in each point data of the point cloud and provides their indexing.

Examples:

(10, 2)

PointCloud

Point cloud class.

This class has a two-dimensional numpy array representing the point cloud, and accesses the elements in the array by means of fields.

Examples:

In this example, you can use the field to extract only the point sequence from a point cloud with points and colors.

__init__(self, data=[], field=<p3dpy.pointcloud.PointXYZField object at 0x7efe5c8b20d0>) special

Constructor

Parameters:

Name Type Description Default
data list or np.ndarray

2D ndarray or list of 1D ndarray. Each row represents one point of the point cloud. Each column represents one scalar field associated to its corresponding point.

[]
field FieldBase

The field of data contained in each point.

<p3dpy.pointcloud.PointXYZField object at 0x7efe5c8b20d0>

compute_normals(self, radius)

Compute normal vectors.

Parameters:

Name Type Description Default
radius float

Radius of the surrounding points used for normal calculation.

required

voxel_grid_filter(pc, voxel_size)

Voxel grid filter

Parameters:

Name Type Description Default
pc PointCloud

Input point cloud.

required
voxel_size float

The length of one side of the voxel.

required

Returns:

Type Description
PointCloud

Voxel-averaged point cloud.

RGBDImage

pointcloud(self, intrinsic, extrinsic=array([[1., 0., 0., 0.],[0., 1., 0., 0.],[0., 0., 1., 0.],[0., 0., 0., 1.]]))

Pointcloud from RGBD Image.

Parameters:

Name Type Description Default
intrinsic ndarray

Camera intrinsic parameters.

required
extrinsic ndarray

Camera extrinsic parameters.

array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]])

Returns:

Type Description
PointCloud

Pointcloud.

load_pcd(fd)

Load PCD file format

Parameters:

Name Type Description Default
fd Union[IO, str]

Input file name or StringIO data type.

required

load_ply(fd)

Load PLY file format

Parameters:

Name Type Description Default
fd Union[IO, str]

Input file name or StringIO data type.

required

load_stl(fd, scale=1.0)

Load STL file format

Parameters:

Name Type Description Default
fd Union[IO, str]

Input file name or StringIO data type.

required