Octree [un]occupied voxels

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Octree [un]occupied voxels

sean9182
When I iterate through the neighbors of an OctreePointCloudAdjacencyContainer, does it return only the voxel represented by a point in the point cloud used to create the tree? If yes, how do I get a list of unoccupied neighbors, for purposes of graph search?

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users
Reply | Threaded
Open this post in threaded view
|

Re: Octree [un]occupied voxels

Fabien Rozar
Hello,

I'm not a specialist of the OctreePointCloudAdjacencyContainer but I like octree
and spend sometiem over the implementation in PCL.

So you are iterating over an adjacency container and you surely use 'cbegin()' over 
a LeafContainerT to do so. When I look at the file 
"octree/octree_pointcloud_adjacency_container.h" to see the definition of 'cbegin()', 
I see (L. 62):
"inline const_iterator cbegin () const { return (neighbors_.begin ()); }"

and when I replace the typedef, I get:
std::list<OctreePointCloudAdjacencyContainer*> neighbors_;

So the 'cbegin()' method return a std::list<>::iterator which doesn't contain any 
information about the location of a leaf in your octree. For me, at the level of container,
you are to deep to get information about the above octree structure.

I notice that because if the iterator give you the octree key of each leaves that you see, 
you can deduce the leaf that are empty after walk through neighbour leaves. For 
example with an octree iterator you  have acccess to the method 'getCurrentOctreeKey()'.

It doesn't seem obvious to get a list of unoccupied neighbours from the container.
Instead, I would use a 'breath_begin()' iterator over an octree, use the octreeKey stuff,
check either the iterator is over an branch node or a leaf node to build the feature
you are looking for.

You should check the test file :
.../pcl_repo/test/octree/test_octree_iterator.cpp
L. 595
to get the flavor of what I'm talking about.

I hope it was useful,
frozar

2018-04-10 18:33 GMT+02:00 Sean Matthews <[hidden email]>:
When I iterate through the neighbors of an OctreePointCloudAdjacencyContainer, does it return only the voxel represented by a point in the point cloud used to create the tree? If yes, how do I get a list of unoccupied neighbors, for purposes of graph search?

_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users



_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users