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
/setMinimumPointsNumberPerVoxel()/.
At the end, the number of points of the/ cloud_filtered/ stays always the
same.
The following code from PCL VOXEL GRID TUTORIAL
<
http://pointclouds.org/documentation/tutorials/voxel_grid.php#voxelgrid>
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.setMinimumPointsNumberPerVoxel(5);
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.orghttp://pointclouds.org/mailman/listinfo/pcl-users