Search code examples
computer-visionpoint-cloud-librarypoint-cloudsvoxel

Understanding the voxel grid implementation of pcl library


I have a point cloud data(x,y,z), I want to voxelize this point cloud and get all the voxels. PCL voxelgrid implementation voxelizes the point cloud and return the centroid of each voxel. Exact implementation of voxel grid is in the url 'http://docs.pointclouds.org/1.8.1/voxel__grid_8hpp_source.html#l00214'. Any other references for voxelizing the point cloud is also appreciable.


Solution

  • You can use OctreePointCloudPointVector for that exact use-case.

    Each leaf is a OctreeContainerPointIndices, where you can get all points inside that leaf with getPointIndicesVector.

    Have a look at test_octree.cpp how to use Octree classes in PCL.