点云技术相关产学研社区

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

扫一扫,访问微社区

查看: 3189|回复: 2

在随机采样中有一个函数setSamplesMaxDist

[复制链接]
发表于 2013-9-4 16:29:26 | 显示全部楼层 |阅读模式
在随机采样中有一个函数setSamplesMaxDist(double & radius,SearchPtr search);用来设置随机采样时样本允许的最大距离。
请问大家SearchPtr search是什么呢?
我直接写的
pcl::SACSegmentation<pcl::PointNormal> Segmentation;
pcl::ModelCoefficients::Ptr coefficients_plane (new pcl::ModelCoefficients);
pcl::PointIndices::Ptr inliers_plane (new pcl::PointIndices);
pcl::SACSegmentation<pcl::PointXYZ>::SearchPtr  search ;
Segmentation.setSamplesMaxDist(3.0,search);
Segmentation.setInputCloud(cloud->makeShared());
Segmentation.segment(*inliers_plane,*coefficients_plane);
这样检测不到平面,不知该如何写,望各位大师指点。
回复

使用道具 举报

 楼主| 发表于 2013-9-4 16:40:17 | 显示全部楼层
        pcl::SACSegmentation<pcl::PointXYZ> Segmentation;
        pcl::ModelCoefficients::Ptr coefficients_plane (new pcl::ModelCoefficients);
        pcl::PointIndices::Ptr inliers_plane (new pcl::PointIndices);
        Segmentation.setOptimizeCoefficients(true);
        Segmentation.setModelType(pcl::SACMODEL_PLANE);
        Segmentation.setMethodType(pcl::SAC_RANSAC);
        Segmentation.setMaxIterations(200);
        pcl::SACSegmentation<pcl::PointXYZ>::SearchPtr  search ;
        Segmentation.setSamplesMaxDist(3.0,search);
        Segmentation.setDistanceThreshold(DistanceThreshold);
        Segmentation.setInputCloud(cloud->makeShared());
        Segmentation.segment(*inliers_plane,*coefficients_plane);
                    完整代码如上所示。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2013-9-4 16:42:41 | 显示全部楼层
去掉下面两行就可以得到结果。pcl::SACSegmentation<pcl::PointXYZ>::SearchPtr  search ;
                                                    Segmentation.setSamplesMaxDist(3.0,search);
函数setSamplesMaxDist()应该如何使用?
回复 支持 反对

使用道具 举报

本版积分规则

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

GMT+8, 2024-5-17 03:19 , Processed in 1.070135 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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