News Articles

Back to the list of articles

New Object Segmentation Algorithms

There are several tools available in PCL trunk that may be useful to the upcoming mobile manipulation challenge. Tools for segmentation of organized point cloud data (as from a Kinect or Xtion) have been added in pcl::OrganizedConnectedComponentSegmentation and pcl::OrganizedMultiPlaneSegmentation. These can be used for fast segmentation of all planes in the scene or euclidean clustering. It can also be extended with your own comparison functions for other segmentation tasks.

An example of how to use the plane segmentation is:

// Segment planes
pcl::OrganizedMultiPlaneSegmentation< PointT, pcl::Normal, pcl::Label > mps;
mps.setMinInliers (10000);
mps.setAngularThreshold (0.017453 * 2.0); // 2 degrees
mps.setDistanceThreshold (0.02); // 2cm
mps.setInputNormals (normal_cloud);
mps.setInputCloud (cloud);
std::vector< pcl::PlanarRegion< PointT > > regions;
mps.segmentAndRefine (regions);

for (size_t i = 0; i < regions.size (); i++)
  Eigen::Vector3f centroid = regions[i].getCentroid ();
  Eigen::Vector4f model = regions[i].getCoefficients ();
  pcl::PointCloud boundary_cloud;
  boundary_cloud.points = regions[i].getContour ();
  printf ("Centroid: (%f, %f, %f)\n  Coefficients: (%f, %f, %f, %f)\n Inliers: %d\n",
          centroid[0], centroid[1], centroid[2],
          model[0], model[1], model[2], model[3],
          boundary_cloud.points.size ());

Some results can be seen here:

For more information, you can download and run a demonstration app from PCL trunk, available in apps/src/organized_segmentation_demo.cpp.

Add a Comment

Latest Posts

Latest Comments