Skip to content

Octree depth iterator #2548

@SergioRamon

Description

@SergioRamon

Hi all
I'm new in PCL, and I don't control C++ iterators, sorry.
Just want to access to the number of node not empty at each level of the octree.
1 8 43 220 904 etc...
The idea was to "scan" the octree at each depth.
Was expected to get the solution with depth iterator, but it doesn't work as hoped.
Does't seem to go down, just give me the number of voxel not empty at the last level:


#include <pcl/octree/octree_impl.h>
...
OctreePointCloudOccupancypcl::PointXYZ BoxTreeO(Resolution);
BoxTreeO.setInputCloud(Cloud);
BoxTreeO.defineBoundingBox(VoxelMin.x, VoxelMin.y, VoxelMin.z, VoxelMax.x, VoxelMax.y, VoxelMax.z);
BoxTreeO.addPointsFromInputCloud();

OctreePointCloudOccupancypcl::PointXYZ::Iterator j;
for (j = BoxTreeO.depth_begin(); j != BoxTreeO.depth_end(); ++j)
{
cout << "Depth:\t\t" << BoxTreeO.getTreeDepth() << endl;
cout << "LeafCount:\t\t" << BoxTreeO.getLeafCount() << endl;
}
BoxTreeO.deleteTree();
return(44);
}


What I am doing wrong, any help please?
Thanks by advance, serge

PCL 1.8.1 All-in-one
MVS 2017
Windows 10.017134

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions