pcl命名空间:segmentation/extract_clusters.h与segmentation/imp/extract_clusters.hpp
extract_cluster.h
- class EuclideanClusterExtraction
- typename
- 成员变量
- 根据欧式距离对点云分割聚类的函数extractEuclideanClusters
- 分割结果比较函数comparePointClusters
- 无预编译扩展extract_clusters.hpp
- 使用示例
class EuclideanClusterExtraction
该类属于模板继承类
template<typename PointT>
class E...: public PCLBase<pointT>
typename
#include <pcl/pcl_base.h>
using BasePCLBase=PCLBase<PointT>//别名BasePCLBase
using PointCloud = pcl::PointCloud<PointT>;using PointCloudPtr = typename PointCloud::Ptr;//PointCloud是上行代码定义的别名using PointCloudConstPtr = typename PointCloud::ConstPtr;//可以写成 =pcl::PointCloud<PointT>::consterPtr;using PointIndicesPtr = PointIndices::Ptr;//可以写成 =pcl::PointIndices::Ptr;
using PointIndicesConstPtr = PointIndices::ConstPtr;
PointCLoud和PointIndices分别在pcl/pcl_base.h中进行了声明
#include <pcl/point_cloud.h>
#include <pcl/PointIndices.h>
#include <pcl/search/pcl_search.h>
using KdTree = pcl::search::Search<PointT>;
using KdTreePtr = typename KdTree::Ptr;
成员变量
KdTreePtr tree_;//储存数据的结构double cluster_tolerance_;//聚类半径int min_pts_per_cluster_;//最小聚类数int max_pts_per_cluster_;//最大聚类数
构造函数完成内参初始化
EuclideanClusterExtraction () : tree_ (), cluster_tolerance_ (0),min_pts_per_cluster_ (1), max_pts_per_cluster_ (std::numeric_limits<int>::max ())//8bits或4bits的最大整数
inline函数实现外参快速传入-----内参赋值
inline void
setSearchMethod (const KdTreePtr &tree)
{ tree_ = tree;
}//设置点云数据结构
inline KdTreePtr
getSearchMethod () const
{ return (tree_);
}//获取内参tree_点云数据结构
class EuclideanClusterExtraction中4个成员以相同方式进行内参赋值
根据欧式距离对点云分割聚类的函数extractEuclideanClusters
template <typename PointT> void //一类点云extractEuclideanClusters (const PointCloud<PointT> &cloud, const typename search::Search<PointT>::Ptr &tree,float tolerance, std::vector<PointIndices> &clusters,unsigned int min_pts_per_cluster = 1, unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ());
template <typename PointT, typename Normal> void //两类点云extractEuclideanClusters (const PointCloud<PointT> &cloud, const PointCloud<Normal> &normals,float tolerance, const typename KdTree<PointT>::Ptr &tree,std::vector<PointIndices> &clusters, double eps_angle,unsigned int min_pts_per_cluster = 1,unsigned int max_pts_per_cluster = (std::numeric_limits<int>::max) ())
还有很多重载函数,但整体结构两大类
分割结果比较函数comparePointClusters
inline bool //a<b返回treecomparePointClusters (const pcl::PointIndices &a, const pcl::PointIndices &b)
无预编译扩展extract_clusters.hpp
将聚类结果以索引为单位存起来
//该方法使用前提是所需内参基本已赋值情况
pcl::EuclideanClusterExtraction<PointT>::extract (std::vector<PointIndices> &clusters){}//结果存在clusters索引引用中
使用示例
//第二步boost::array<std::vector<int>, 10> indices_array;//存点云簇indices_array[1].push_back(点云索引);//todo:该行代码需要具体的"点云索引"boost::shared_ptr<std::vector<int> > indices_array_ptr(new std::vector<int>(indices_array[1]));//将点云存入ketreepcl::search::KdTree<pcl::PointXYZI>::Ptr tree(new pcl::search::KdTree<pcl::PointXYZI>);pcl::PointCloud<pcl::PointXYZI>::Ptr pcl_in(new pcl::PointCloud<pcl::PointXYZI>);/*todo:补充点云来源的pcd文件*///第一步(上层结构,需要开辟什么空间再在第二步中开辟)tree->setInputCloud(pcl_in, indices_array_ptr);//欧式聚类std::vector<pcl::PointIndices> cluster_indices;//一个装聚类点云团索引的容器pcl::EuclideanClusterExtraction<pcl::PointXYZI> ec;//设置欧式聚类对象ec.setClusterTolerance(tolerance);ec.setMinClusterSize(cluster_size_min_);//设置聚类的最小值ec.setMaxClusterSize(cluster_size_max_);//设置聚类的最大值ec.setSearchMethod(tree);//设置搜索方式ec.setInputCloud(pcl_pc_in);//设置输入的点云ec.setIndices(indices_array_ptr);ec.extract(cluster_indices);
pcl命名空间:segmentation/extract_clusters.h与segmentation/imp/extract_clusters.hpp相关推荐
- PCL 点云分割与分类 Segmentation RANSAC随机采样一致性 平面模型分割 欧氏距离分割 区域聚类分割算法 最小分割算法 超体聚类 渐进式形态学滤波器
点云分割 博文末尾支持二维码赞赏哦 _ 点云分割是根据空间,几何和纹理等特征对点云进行划分, 使得同一划分内的点云拥有相似的特征,点云的有效分割往往是许多应用的前提, 例如逆向工作,CAD领域对零件的 ...
- PCL:官方程序 Region growing segmentation
区域增长分割(算法不是很懂,有特别明白的可以给我讲讲疑问部分???) 在本教程中,我们将学习如何将pcl:: regiongrow cla在用实现区域增长算法.该算法的目的是在平滑约束条件下,将足够接 ...
- PCL学习笔记,区域生长分割(region growing segmentation)
在本博文中,我主要介绍如何在pcl::RegionGrowing类中调用区域增长算法.首先注意一点,这里是region growing segmentation,不是color-based regio ...
- 读自动驾驶激光雷达物体检测技术(Lidar Obstacle Detection)(3):Segmentation
Segmentation的任务是将属于道路的点和属于场景的点分开,在该分割部分作者工使用了两种方法: 第一种: 下图中的12分别是第一种程序保存的点云结果. 下面是保存的点云的可视化结果: obstC ...
- Difference of Normals Based Segmentation
文章目录 例子 官网的可视化图片流程 C++ cmakelist 参考 记录翻译一下pcl中的例子 实现的"法线差"功能,用于基于比例的无组织点云分割. 例子 官网的可视化图片流程 ...
- 基于最小割的分割算法(Min-Cut Based Segmentation)
参考: https://www.cnblogs.com/ironstark/p/5008258.html https://github.com/Ewenwan/MVision/blob/master/ ...
- 车道线检测--Towards End-to-End Lane Detection: an Instance Segmentation Approach
Towards End-to-End Lane Detection: an Instance Segmentation Approach In IEEE Intelligent Vehicles Sy ...
- C/C++中的段错误(Segmentation fault)[转]
Segment fault 之所以能够流行于世,是与Glibc库中基本所有的函数都默认型参指针为非空有着密切关系的. 来自:http://oss.lzu.edu.cn/blog/article.php ...
- 【论文笔记】PSEUDOSEG: DESIGNING PSEUDO LABELS FOR SEMANTIC SEGMENTATION
论文笔记 1.论文题目 2.作者及研究单位 3.摘要 4.简介 (1)这篇论文针对什么问题展开的研究 (2)已有工作是如何解决这些问题的(已有工作存在什么不足) (3)这篇论文是如何做的(如何弥足已有 ...
- Weakly Supervised Semantic Segmentation list
Weakly Supervised Semantic Segmentation list 文章转自Github:https://github.com/JackieZhangdx/WeakSupervi ...
最新文章
- 左滑右滑,在VS Code里滑个妹纸给你写喜欢的代码?
- java继承与初始化
- Python day7之mysql
- js自动滚动条在底部
- 滑动窗口最大值的golang实现
- USB学习笔记--USB枚举过程
- linux 无线网络特别慢,Ubuntu 16.04 LTS连接无线上网慢的解决
- apizza开发工具
- MicroSIP软电话的安装和使用--从电脑上接听和拨打电话
- python傅里叶谐波分析_一种利用快速三角形式傅里叶变换的信号谐波分析方法
- 让FireFox火狐支持迅雷精简版
- IE8升级到IE11 F12报错的解决方案
- r语言nonzerocoef函数_文献汇报||Lasso方法在肿瘤基因位点筛选中的应用
- python任务编排_基于DAG实现的任务编排框架平台
- 卡西欧计算机储存数据,卡西欧计算器(统计计算)操作.ppt
- excel表格怎么恢复?常见的恢复方法
- 链路聚合-负载分担方式
- HDU 5473(There was a kingdom-凸包+dp)
- iis服务器修改端口,Bindings bindings
- 逝去的天际之风——神乐
热门文章
- 时间复杂度和空间复杂度
- python中的Rotation常见报错问题
- 森林老是显示连接服务器超时,乌鸦森林之谜3:卡赫拉之影无法连接服务器是什么原因...
- 3D建模:14个建模小技巧
- 在win7的iis下部署asp网站
- 2021东阳高考成绩查询,2021金华市地区高考成绩排名查询,金华市高考各高中成绩喜报榜单...
- oracle数据库用户状态失效Expired
- mysql密码expired_mysql密码过期的修改方法(your password has expired)
- Android渠道包生成工具(支持V1、V2签名)
- 北漂真的是你的归宿吗?