VoxelGrid::setMinimumPointsNumberPerVoxel() not working ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

VoxelGrid::setMinimumPointsNumberPerVoxel() not working ?

I would like to specify a minimum number of points which have to appear
within a single voxel.
If there are less points, the voxel should be ignored.

I know that there is the function /setMinimumPointsNumberPerVoxel()/ (PCL
1.8) but I am not sure if it is working as expected.
It does not matter which value is passed to
At the end, the number of points of the/ cloud_filtered/ stays always the

The following code from  PCL VOXEL GRID TUTORIAL
with a little modification was used for testing:

pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ());
pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2 ());

// Create the filtering object
std::cout << "Points before: " << cloud->width * cloud->height << std::endl;

pcl::VoxelGrid<pcl::PCLPointCloud2> sor;
sor.setInputCloud (cloud);
sor.setLeafSize (0.01f, 0.01f, 0.01f);
sor.filter (*cloud_filtered);

std::cout << "Points after: " << cloud_filtered->width *
cloud_filtered->height << std::endl;

Sent from: http://www.pcl-users.org/
[hidden email] / http://pointclouds.org