ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Filtering pointcloud with voxel grid giving different number of data points

asked 2016-02-11 02:10:10 -0500

jhlim6 gravatar image

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;

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-02-11 02:22:27 -0500

The voxel grid fiilter downsamples the point cloud computing a "substitute" point for all points that are found within a voxel. Due to noise in sensor data, no received point cloud is exactly the same and thus there is some variability in the number of points of the voxel grid filtered pointcloud.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-02-11 02:10:10 -0500

Seen: 1,903 times

Last updated: Feb 11 '16