[ros-users] Simplest way to segment spatially separated objects in point clouds?

Zoltan-Csaba Marton marton at cs.tum.edu
Mon Apr 18 15:59:50 UTC 2011


Hi Björn,

PCL has euclidean cluster extraction function and class and also convex
hull.. but there is no tutorial for it yet. Nonetheless, it is very
simple to use. Here is a hacked together sample code (suppose msg is
your sensor_msgs::PointCloud2 input):

pcl::PointCloud<PointT>::Ptr cloud
  (new pcl::PointCloud<pcl::PointXYZRGB>);
pcl::fromROSMsg (msg, *cloud);
pcl::EuclideanClusterExtraction<pcl::PointXYZRGB> ece;
std::vector<pcl::PointIndices> clusters;
ece.setInputCloud (cloud);
ece.setMinClusterSize (10);
ece.setClusterTolerance (0.05);
ece.extract (clusters);
ROS_INFO_STREAM ("No of clusters: " << clusters.size () << std::endl);

Hope this helps.

Cheers,
Zoltan

On Mon, 2011-04-18 at 17:35 +0200, Björn Giesler wrote:
> Hi all,
> 
> I'd like to use my robot's Kinect to find objects (obstacles / humans) in 3D. The way the sensor is integrated, it cannot see the ground plane, so segmentation should be very easy because no objects are connected by any structure. What I'm looking for is the simplest way to segment the point cloud into non-connected sub clouds or convex hulls thereof. I've found the border extraction tutorial, which kind of seems to do what I want... Is that it or is there an even simpler way?
> 
> Thanks a lot & regards,
> Björn
> 
> Von meinem iPad gesendet
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users





More information about the ros-users mailing list