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 ...
最新文章
- python怎么读xlsx_用python读取xlsx文件
- c语言什么是内联函数,C语言中内联函数inline的使用方法
- tensorboard ValueError: Duplicate plugins for name projector
- MyBatis 源码解读-settingsAsProperties()
- 如何获得select被选中option的value和text
- linux权限sudo和su,Linux su和sudo命令的区别,并获得root权限
- locust mysql_locust性能压测连接mysql,随机取出班级,绑定学生
- Ubuntu 下PySpark安装
- 车辆保险过户所需材料(郑州)
- 代码生成器集合(整理)
- miniusbpcb封装_MINI MICRO A型B型D型USB多类型Altium AD元件库 PCB封装库的电路方案详解...
- 在线Cron表达式生成器,定时任务表达式生成器
- 基于蚁群算法的多配送中心的车辆调度问题的研究(Matlab代码实现)
- xposed框架安全模式_Android 系统上的 Xposed 框架中都有哪些值得推荐的模块?
- 【Usaco2008 Mar】土地购买
- 一个海量在线用户即时通讯系统(IM)的完整设计
- mand-mobile-rn 多 Android Module link 实现
- 【数据结构】图1——图的基本概念和术语、类型定义
- windows 安装Abin
- kindle的xray怎么用_xray 使用说明高级版领取方式