PCL
http://www.pointclouds.org/documentation/tutorials/#filtering-tutorial
每个模块点击进去后,有demo可以查看
源码编译打开option开关with_docs true,生成html文档
PCD
width、height绘制的网格中,height>1有序点云,height==1无序点云
sensor_origin_ 中心点
sensor_orientation_ 模型矩阵
point类型(体素类型),不同类型的点数据,加载出来的图像不同
PointXYZ 常用无色点云数据
PointXYZI i表示强度(intensity),距离越近强度越高
PointXYZRGB RGB颜色使用float存储,彩色点云
filed:concatenateFields拼接点云的数据坐标和法线数据等 PointCloud–>PointCloudNormal
点云数据合并 a+b=c点云
ply
pcl支持pcd和ply文件,meshlab支持ply
Segment
欧几里德
std::vectorcluster_indices;
//欧式分割器
pcl::EuclideanClusterExtractionec;
ec.setClusterTolerance (0.02); // 2cm
ec.setMinClusterSize (100);
ec.setMaxClusterSize (25000);
//搜索策略树
ec.setSearchMethod (tree);
ec.setInputCloud (cloud_filtered);
ec.extract (cluster_indices);
区域生长
//一个点云团队列,用于存放聚类结果
std::vector clusters;
//区域生长分割器
pcl::RegionGrowingreg;
//输入分割目标
reg.setSearchMethod (tree);
reg.setNumberOfNeighbours (30);
reg.setInputCloud (cloud);
//reg.setIndices (indices);
reg.setInputNormals (normals);
//设置限制条件及先验知识
reg.setMinClusterSize (50);
reg.setMaxClusterSize (1000000);
reg.setSmoothnessThreshold (3.0 / 180.0 * M_PI);
reg.setCurvatureThreshold (1.0);
reg.extract (clusters);
ransac随机抽样一致算法(类似最小而乘法的拟合算法,抗燥能力较强),存在不确定性(不一定拟合),为了提高准确度需要提高迭代次数
pcl::SACSegmentationseg;
seg.setOptimizeCoefficients (true);
seg.setModelType (pcl::SACMODEL_PLANE);
seg.setMethodType (pcl::S