点云技术相关产学研社区

 找回密码
 立即注册加入PCL中国点云技术相关产学研社区

扫一扫,访问微社区

查看: 2812|回复: 3

关于圆柱体的点云分割

[复制链接]
发表于 2016-4-20 12:55:48 | 显示全部楼层 |阅读模式
  我是想直接运用14章那个例子来做一个可以识别圆柱体并且能够识别他的参数的,现在不知道是否可以直接获取分割后的点的坐标,希望有大神能够给点参考意见,或者是有别的不同方法的,我们可以交流一下。QQ364950542
回复

使用道具 举报

发表于 2016-4-20 16:26:09 | 显示全部楼层
pcl::SACSegmentationFromNormals<pcl::PointXYZ, pcl::Normal> seg;
        pcl::ExtractIndices<pcl::PointXYZ> extract;

        // Datasets
        pcl::PointIndices::Ptr inliers_cylinder (new pcl::PointIndices);

        // Create the segmentation object for cylinder segmentation and set all the parameters
        seg.setOptimizeCoefficients (true);
        seg.setModelType (pcl::SACMODEL_CYLINDER);
        seg.setMethodType (pcl::SAC_RANSAC);
        seg.setNormalDistanceWeight (0.01);
        seg.setMaxIterations (100);
        seg.setDistanceThreshold (0.05);
        seg.setRadiusLimits (0.0,0.8);
        seg.setInputCloud (cloud);
        seg.setInputNormals (cloud_normals);

        // Obtain the cylinder inliers and coefficients
        seg.segment (*inliers_cylinder, *coefficients_cylinder);

        // Write the cylinder inliers to disk
        extract.setInputCloud (cloud);
        extract.setIndices (inliers_cylinder);
        extract.setNegative (false);
       
        extract.filter (*cloud_cylinder);


cloud_cylinder->points就是你要的点

回复 支持 反对

使用道具 举报

 楼主| 发表于 2016-4-21 13:24:25 | 显示全部楼层
Halbert.Z 发表于 2016-4-20 16:26
pcl::SACSegmentationFromNormals seg;
        pcl::ExtractIndices extract;

哥们我按你那些输入,.z”的左边必须有类/结构/联合   报错是这个样的请问是什么意思。。?
回复 支持 反对

使用道具 举报

发表于 2016-10-10 10:55:57 | 显示全部楼层
Halbert.Z 发表于 2016-4-20 16:26
pcl::SACSegmentationFromNormals seg;
        pcl::ExtractIndices extract;

想问一下SACSegmentationFromNormals,和SACSegmentation什么区别,提取原柱面必须用SACSegmentationFromNormals的吗?
回复 支持 反对

使用道具 举报

本版积分规则

QQ|小黑屋|点云技术相关产学研社区 ( 陕ICP备13001629号 )

GMT+8, 2024-4-29 04:40 , Processed in 1.885720 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表