VoxelGrid on arbitrary domain

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

VoxelGrid on arbitrary domain

cammarasana123
Hello everybody,

I would need to create a voxelgrid on a cube domain, let's say a room, where
a point cloud moves

I know how to create a voxelgrid on a cloud..and if I have more clouds I
could simply join them and create a voxelgrid on the "assembled" point
cloud.

But my question is: is it possilbe to create a voxel grid, givin as input
only the limits of the room, and then perform queris from any point cloud to
this grid?
basically, I do not want to bind my voxelgrid to a point cloud

Thanks for any support

Simone



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

Re: VoxelGrid on arbitrary domain

cammarasana123
I want to share the solution I've found.
If I have a new point cloud, I need to define a new octree ad associate it
to new point cloud

typedef std::vector< PointXYZ, Eigen::aligned_allocator< PointXYZ > >
AlignedPointTVector;

//BOUND PARAMETER
        float resolution = 0.05f;
        float minX = -2, minY = -2, minZ = -2, maxX = +2, maxY = +2, maxZ = +2;
//room extremes

//BUILD OCTREE
  pcl::octree::OctreePointCloud<pcl::PointXYZ> octree (resolution);
  octree.defineBoundingBox (minX,minY,minZ,maxX,maxY,maxZ);

//ASSOCIATE POINT CLOUD TO OCTREE
  octree.setInputCloud (myPtrCloud);
  octree.addPointsFromInputCloud ();

//FIND VOXELCENTER
        AlignedPointTVector voxelCenterList;
        octree.getOccupiedVoxelCenters(voxelCenterList);

//FIND VOXEL DIAMETER
        double dia = octree.getVoxelSquaredDiameter();



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