PCL Octree Cheat Sheet

The point cloud library (PCL) is a fantastic resource for working with point clouds, however it is a large library and it can take a while to effectively find your way around it. The octree construct is very useful for working with point clouds, but again it can take a while to learn how to interact with octrees. To help me to remember how to interact with them I will include some examples here:

To iterate across the nodes of an octree (depth first):

To iterate across the leaf nodes:


Get a Voxel’s Bounding Region given node iterator:

Get point indices from leaf node iterator

Get point indices from leaf node pointer