Skip to main content

VoxelGrid

https://pointclouds.org/documentation/classpcl_1_1_voxel_grid.html

VoxelGrid assembles a local 3D grid over a given PointCloud, and downsamples + filters the data.

The VoxelGrid class creates a 3D voxel grid (think about a voxel grid as a set of tiny 3D boxes in space) over the input point cloud data. Then, in each voxel (i.e., 3D box), all the points present will be approximated (i.e., downsampled) with their centroid. This approach is a bit slower than approximating them with the center of the voxel, but it represents the underlying surface more accurately.

Constructor​

new PCL.VoxelGrid(pointType);

Parameters:

NameTypeDefaultDescription
pointTypePointTypePointXYZThe point cloud type.

Methods​

setLeafSize()​

setLeafSize(lx, ly, lz)

Parameters:

NameTypeDefaultDescription
lxnumberthe leaf size for X.
lynumberthe leaf size for Y.
lznumberthe leaf size for Z.

setDownsampleAllData()​

setLeafSize(downsample);

Set to true if all fields need to be downsampled, or false if just XYZ.

Parameters:

NameTypeDefaultDescription
downsamplebooleanThe new value (true/false)
.

getDownsampleAllData()​

getDownsampleAllData();

Get the state of the internal downsampling parameter (true if all fields need to be downsampled, false if just XYZ).

Returns:

NameType
downsampleboolean

setMinimumPointsNumberPerVoxel()​

setMinimumPointsNumberPerVoxel(minPointsPerVoxel);

Set the minimum number of points required for a voxel to be used.

Parameters:

NameTypeDefaultDescription
minPointsPerVoxelnumberThe minimum number of points for required for a voxel to be used.

getMinimumPointsNumberPerVoxel()​

getMinimumPointsNumberPerVoxel();

Return the minimum number of points required for a voxel to be used.

Returns:

NameType
minPointsPerVoxelnumber

setInputCloud​

See PassThrough.setInputCloud

getInputCloud​

See PassThrough.getInputCloud

filter​

See PassThrough.filter