pcl

PCL1.8.1 分割 - 区域增长

烈酒焚心 提交于 2019-12-06 02:26:53
Region growing segmentation 该算法用于拟合点云中所有的平面。 算法核心:该算法是基于点法线之间角度的比较,企图将满足平滑约束的相邻点合并在一起,以一簇点集的形式输出。每簇点集被认为是属于相同平面。 工作原理:区域增长是从有最小曲率值(curvature value)的点开始的。因此,我们必须计算出所有曲率值,并对它们进行排序。这是因为曲率最小的点位于平坦区域,而从最平坦的区域增长可以减少区域的总数。现在我们来具体描述这个过程: 1.点云中有未标记点,按照点的曲率值对点进行排序,找到最小曲率值点,并把它添加到种子点集; 2.对于每个种子点,算法都会发现周边的所有近邻点。1)计算每个近邻点与当前种子点的法线角度差(reg.setSmoothnessThreshold),如果差值小于设置的阈值,则该近邻点被重点考虑,进行第二步测试;2)该近邻点通过了法线角度差检验,如果它的曲率小于我们设定的阈值(reg.setCurvatureThreshold),这个点就被添加到种子点集,即属于当前平面。 3.通过两次检验的点,被从原始点云去除。 4.设置最小点簇的点数min(reg.setMinClusterSize),最大点簇为max(reg.setMaxClusterSize)。 4.重复1-3步,算法会生成点数在min和max的所有平面

PCL1.8.1 分割 - 欧式聚类

我的梦境 提交于 2019-12-06 02:19:12
Euclidean Cluster Extraction 欧式聚类流程如下: http://pointclouds.org/documentation/tutorials/cluster_extraction.php#cluster-extraction #include <pcl/kdtree/kdtree.h> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> #include <pcl/segmentation/extract_clusters.h> pcl::PointCloud<pcl::PointXYZ>::Ptr cloud_filtered (new pcl::PointCloud<pcl::PointXYZ>); // Creating the KdTree object for the search method of the extraction pcl::search::KdTree<pcl::PointXYZ>::Ptr tree (new pcl::search::KdTree<pcl::PointXYZ>); tree->setInputCloud (cloud_filtered); std::vector<pcl::PointIndices> cluster_indices; pcl:

PCL1.8.1 分割 - cylinder model

时光总嘲笑我的痴心妄想 提交于 2019-12-06 02:01:49
圆柱模型 http://pointclouds.org/documentation/tutorials/cylinder_segmentation.php#cylinder-segmentation #include <pcl/ModelCoefficients.h> #include <pcl/point_types.h> #include <pcl/sample_consensus/method_types.h> #include <pcl/sample_consensus/model_types.h> #include <pcl/segmentation/sac_segmentation.h> #include <pcl/features/normal_3d.h> typedef pcl::PointXYZ PointT; pcl::SACSegmentationFromNormals<PointT, pcl::Normal> seg; pcl::PointCloud<PointT>::Ptr cloud_filtered2 (new pcl::PointCloud<PointT>); pcl::PointCloud<pcl::Normal>::Ptr cloud_normals2 (new pcl::PointCloud<pcl::Normal>); // Create

PCL1.8.1 提取分割后的点云

主宰稳场 提交于 2019-12-06 02:00:22
使用分割算法分割完成后,会将分割的点云索引保存在pcl::PointIndices类型的数据中,实际上是一个vector的数组。通过该indices使用pcl::ExtractIndices<PointT>把点云提取到单独的点云中。 http://pointclouds.org/documentation/tutorials/cylinder_segmentation.php#cylinder-segmentation #include <pcl/filters/extract_indices.h> typedef pcl::PointXYZ PointT; //分割的输入点云 pcl::PointCloud<PointT>::Ptr cloud(new pcl::PointCloud<PointT>); //保存分割后点云的数据索引 pcl::PointIndices::Ptr inliers_plane(new pcl::PointIndices); //提取 pcl::ExtractIndices<PointT> extract; extract.setInputCloud(cloud); extract.setIndices(inliers_plane); //保存提取的plane点云 extract.setNegative(false); //存放提取的plane点云

PCL1.8.1 分割 - Plane model

蓝咒 提交于 2019-12-06 00:44:06
通过平面进行分割,代码中随机生成z=1平面上的点,修改三个点的z!=1,使用平面分割保留z=1上的点。 http://www.pointclouds.org/documentation/tutorials/planar_segmentation.php#planar-segmentation #include <iostream> #include <pcl/ModelCoefficients.h> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> #include <pcl/sample_consensus/method_types.h> #include <pcl/sample_consensus/model_types.h> #include <pcl/segmentation/sac_segmentation.h> int main (int argc, char** argv) { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); // Fill in the cloud data cloud->width = 15; cloud->height = 1; cloud->points.resize

PCL1.8.1 随机产生点云数据

这一生的挚爱 提交于 2019-12-06 00:00:16
#include <pcl/point_types.h> pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); // Fill in the cloud data cloud->width = 15; cloud->height = 1; cloud->points.resize(cloud->width * cloud->height); // Generate the data for (std::size_t i = 0; i < cloud->points.size(); ++i) { cloud->points[i].x = 1024 * rand() / (RAND_MAX + 1.0f); cloud->points[i].y = 1024 * rand() / (RAND_MAX + 1.0f); cloud->points[i].z = 1.0; } 来源: https://my.oschina.net/u/4228078/blog/3135061

PCL1.8.1 Feature - VFH

青春壹個敷衍的年華 提交于 2019-12-05 23:33:17
Viewpoint Feature Histogram VFH(视点特征直方图)描述子,可以应用在点云聚类识别和六自由度位姿估计问题。最终计算得到的VFH点云大小为1,即vfhs->points.size()=1. http://www.pointclouds.org/documentation/tutorials/vfh_estimation.php#vfh #include <pcl/point_types.h> #include <pcl/features/vfh.h> { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal> ()); ... read, pass in or create a point cloud with normals ... ... (note: you can create a single PointCloud<PointNormal> if you want) ... // Create the VFH estimation class, and pass the input

PCL1.8.1 Feature - FPFH

好久不见. 提交于 2019-12-05 23:17:13
Fast Point Feature Histograms (FPFH) 执行效率慢,占用大量CPU pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); // Create the FPFH estimation class, and pass the input dataset+normals to it pcl::FPFHEstimation<pcl::PointXYZ, pcl::Normal, pcl::FPFHSignature33> fpfh; //使用OMP多线程加速执行,待验证 //pcl::FPFHEstimationOMP<pcl::PointXYZ, pcl::Normal, pcl::FPFHSignature33> fpfh; //fpfh.setNumberOfThreads(8); fpfh.setInputCloud(cloud); fpfh.setInputNormals(normals); // alternatively, if cloud is of tpe PointNormal, do fpfh.setInputNormals (cloud); // Create an empty kdtree representation, and

PCL1.8.1 Feature - PFH

北城余情 提交于 2019-12-05 23:06:59
PFH(Point Feature Histograms) 表面法线和曲率估计是某个点周围的几何特征表示法,计算速度快,但无法获得太多信息,因为它只是通过使用很少的几个参数值来近似表示一个点K的邻域的几何特性。 通过点特征直方图可以提供一个可度量的信息空间,详细可查看论文: Persistent Point Feature Histograms for 3D Point Clouds . http://www.pointclouds.org/documentation/tutorials/pfh_estimation.php#pfh-estimation #include <pcl/point_types.h> #include <pcl/features/pfh.h> { pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>); pcl::PointCloud<pcl::Normal>::Ptr normals (new pcl::PointCloud<pcl::Normal> ()); ... read, pass in or create a point cloud with normals ... ... (note: you can create a single

ros+pcl error recoder

断了今生、忘了曾经 提交于 2019-12-05 23:01:27
Could not find a package configuration file provided by "pcl_conversions" with any of the following names: pcl_conversionsConfig.cmake pcl_conversions-config.cmake after running catkin_make $sudo apt-get update $sudo apt-get install ros-indigo-pcl-conversions $sudo apt-get install ros-indigo-pcl-ros 来源: https://www.cnblogs.com/gris/p/11949486.html