Filtering pointcloud with voxel grid giving different number of data points
Hi, I try using the voxel grid filter on a pointcloud generated by the Ensenso camera. While the camera is held stationary, it gives a constant number of data points, however with a voxel grid filter of 0.01f (1cm). I've been received different number of data points back. Why is this the case.
std::cerr << "PointCloud before filtering: " << cloud_blob->width * cloud_blob->height << " data points." << std::endl;
// Create the filtering object: downsample the dataset using a leaf size of 1cm
pcl::VoxelGrid<pcl::pclpointcloud2> sor;
sor.setInputCloud (cloud_blob);
sor.setLeafSize (0.01f, 0.01f, 0.01f);
sor.filter (cloud_filtered_blob); //pcd saved in cloud_filtered_blob
pcl::fromPCLPointCloud2 (cloud_filtered_blob, *cloud_filtered);
std::cerr << "PointCloud after filtering: " << cloud_filtered->width * cloud_filtered->height << " data points." << std::endl;