PCL中Sample_consensus分割支持的几何模型
随机采样一致分割法,从点云中分割出线、面等几何元素
#include <pcl/sample_consensus/method_types.h>
#include <pcl/sample_consensus/model_types.h>
#include <pcl/segmentation/sac_segmentation.h> // Create the segmentation object
pcl::SACSegmentation<pcl::PointXYZ> seg; // Optional
seg.setOptimizeCoefficients (true); // Mandatory
seg.setModelType (pcl::SACMODEL_PLANE); //model: plane
seg.setMethodType (pcl::SAC_RANSAC);
(1) SACMODEL_PLANE(三维平面)
- used to determine plane models. The four coefficients of the plane are itsHessian Normal form: [normal_x normal_y normal_z d]
- a : the X coordinate of the plane's normal (normalized)
- b : the Y coordinate of the plane's normal (normalized)
- c : the Z coordinate of the plane's normal (normalized)
- d : the fourth Hessian component of the plane's equation
- used to determine line models. The six coefficients of the line are given by a point on the line and the direction of the line as: [point_on_line.x point_on_line.y point_on_line.z line_direction.x line_direction.y line_direction.z]
- point_on_line.x : the X coordinate of a point on the line
- point_on_line.y : the Y coordinate of a point on the line
- point_on_line.z : the Z coordinate of a point on the line
- line_direction.x : the X coordinate of a line's direction
- line_direction.y : the Y coordinate of a line's direction
- line_direction.z : the Z coordinate of a line's direction
- used to determine 2D circles in a plane. The circle's three coefficients are given by its center and radius as: [center.x center.y radius]
- center.x : the X coordinate of the circle's center
- center.y : the Y coordinate of the circle's center
- radius : the circle's radius
- not implemented yet
(5) SACMODEL_SPHERE(球)
- used to determine sphere models. The four coefficients of the sphere are given by its 3D center and radius as: [center.x center.y center.z radius]
- center.x : the X coordinate of the sphere's center
- center.y : the Y coordinate of the sphere's center
- center.z : the Z coordinate of the sphere's center
- radius : the sphere's radius
- used to determine cylinder models. The seven coefficients of the cylinder are given by a point on its axis, the axis direction, and a radius, as: [point_on_axis.x point_on_axis.y point_on_axis.z axis_direction.x axis_direction.y axis_direction.z radius]
- point_on_axis.x : the X coordinate of a point located on the cylinder axis
- point_on_axis.y : the Y coordinate of a point located on the cylinder axis
- point_on_axis.z : the Z coordinate of a point located on the cylinder axis
- axis_direction.x : the X coordinate of the cylinder's axis direction
- axis_direction.y : the Y coordinate of the cylinder's axis direction
- axis_direction.z : the Z coordinate of the cylinder's axis direction
- radius : the cylinder's radius
- not implemented yet
- not implemented yet
(9) SACMODEL_PARALLEL_LINE(平行线)
- a model for determining a line parallel with a given axis, within a maximum specified angular deviation. The line coefficients are similar toSACMODEL_LINE.
- SampleConsensusModelParallelLine defines a model for 3D line segmentation using additional angular constraints.
The model coefficients are defined as:
- point_on_line.x : the X coordinate of a point on the line
- point_on_line.y : the Y coordinate of a point on the line
- point_on_line.z : the Z coordinate of a point on the line
- line_direction.x : the X coordinate of a line's direction
- line_direction.y : the Y coordinate of a line's direction
- line_direction.z : the Z coordinate of a line's direction
- a model for determining a plane perpendicular to an user-specified axis, within a maximum specified angular deviation. The plane coefficients are similar to SACMODEL_PLANE.
- SampleConsensusModelPerpendicularPlane defines a model for 3D plane segmentation using additional angular constraints.The plane must be perpendicular to an user-specified axis (setAxis), up to an user-specified angle threshold (setEpsAngle).
The model coefficients are defined as:
- a : the X coordinate of the plane's normal (normalized)
- b : the Y coordinate of the plane's normal (normalized)
- c : the Z coordinate of the plane's normal (normalized)
- d : the fourth Hessian component of the plane's equation
Code example for a plane model, perpendicular (within a 15 degrees tolerance) with the Z axis:
SampleConsensusModelPerpendicularPlane<pcl::PointXYZ> model (cloud);
model.setAxis (Eigen::Vector3f (0.0, 0.0, 1.0));
model.setEpsAngle (pcl::deg2rad ());
- Note:
- Please remember that you need to specify an angle > 0 in order to activate the axis-angle constraint!
-
(11) SACMODEL_PARALLEL_LINES
- not implemented yet
- a model for determining plane models using an additional constraint: the surface normals at each inlier point has to be parallel to the surface normal of the output plane, within a maximum specified angular deviation. The plane coefficients are similar to SACMODEL_PLANE.
- SampleConsensusModelNormalPlane defines a model for 3D plane segmentation using additional surface normal constraints.
- Basically this means that checking for inliers will not only involve a "distance to model" criterion, but also an additional "maximum angular deviation" between the plane's normal and the inlier points normals.
The model coefficients are defined as:
- a : the X coordinate of the plane's normal (normalized)
- b : the Y coordinate of the plane's normal (normalized)
- c : the Z coordinate of the plane's normal (normalized)
- d : the fourth Hessian component of the plane's equation
To set the influence of the surface normals in the inlier estimation process, set the normal weight (0.0-1.0), e.g.:
SampleConsensusModelNormalPlane<pcl::PointXYZ, pcl::Normal> sac_model;
...
sac_model.setNormalDistanceWeight (0.1);
...
- a model for determining a plane parallel to an user-specified axis, within a maximim specified angular deviation. SACMODEL_PLANE.
- SampleConsensusModelParallelPlane defines a model for 3D plane segmentation using additional angular constraints.The plane must be parallel to a user-specified axis (setAxis) within an user-specified angle threshold (setEpsAngle).
Code example for a plane model, parallel (within a 15 degrees tolerance) with the Z axis:
SampleConsensusModelParallelPlane<pcl::PointXYZ> model (cloud);
model.setAxis (Eigen::Vector3f (0.0, 0.0, 1.0));
model.setEpsAngle (pcl::deg2rad ());
(14) SACMODEL_NORMAL_PARALLEL_PLANE
- defines a model for 3D plane segmentation using additional surface normal constraints. The plane must lieparallel to a user-specified axis. SACMODEL_NORMAL_PARALLEL_PLANE therefore is equivallent to SACMODEL_NORMAL_PLANE + SACMODEL_PARALLEL_PLANE. The plane coefficients are similar toSACMODEL_PLANE.
- SampleConsensusModelNormalParallelPlane defines a model for 3D plane segmentation using additional surface normal constraints.
- Basically this means that checking for inliers will not only involve a "distance to model" criterion, but also an additional "maximum angular deviation" between the plane's normal and the inlier points normals. In addition, the plane normal must lie parallel to an user-specified axis.
The model coefficients are defined as:
- a : the X coordinate of the plane's normal (normalized)
- b : the Y coordinate of the plane's normal (normalized)
- c : the Z coordinate of the plane's normal (normalized)
- d : the fourth Hessian component of the plane's equation
To set the influence of the surface normals in the inlier estimation process, set the normal weight (0.0-1.0), e.g.:
SampleConsensusModelNormalPlane<pcl::PointXYZ, pcl::Normal> sac_model;
...
sac_model.setNormalDistanceWeight (0.1);
...
文章引用自 https://blog.csdn.net/sdau20104555/article/details/40649101
PCL中Sample_consensus分割支持的几何模型的更多相关文章
- 基于传统方法点云分割以及PCL中分割模块
之前在微信公众号中更新了以下几个章节 1,如何学习PCL以及一些基础的知识 2,PCL中IO口以及common模块的介绍 3,PCL中常用的两种数据结构KDtree以及Octree树的介绍 ...
- PCL—点云分割(RanSaC)低层次点云处理
博客转载自:http://blog.csdn.net/app_12062011/article/details/78131318 点云分割 点云分割可谓点云处理的精髓,也是三维图像相对二维图像最大优势 ...
- PCL点云分割(1)
点云分割是根据空间,几何和纹理等特征对点云进行划分,使得同一划分内的点云拥有相似的特征,点云的有效分割往往是许多应用的前提,例如逆向工作,CAD领域对零件的不同扫描表面进行分割,然后才能更好的进行空洞 ...
- PCL点云分割(3)
(1)Euclidean分割 欧几里德分割法是最简单的.检查两点之间的距离.如果小于阈值,则两者被认为属于同一簇.它的工作原理就像一个洪水填充算法:在点云中的一个点被“标记”则表示为选择在一个的集群中 ...
- PCL中的OpenNI点云获取框架(OpenNI Grabber Framework in PCL)
从PCL 1.0开始,PCL(三维点云处理库Point Cloud Library)提供了一个通用采集接口,这样可以方便地连接到不同的设备及其驱动.文件格式和其他数据源.PCL集成的第一个数据获取驱动 ...
- kd-tree理论以及在PCL 中的代码的实现
(小技巧记录:博客园编辑的网页界面变小了使用Ctrl ++来变大网页字体) 通过雷达,激光扫描,立体摄像机等三维测量设备获取的点云数据,具有数据量大,分布不均匀等特点,作为三维领域中一个重要的数据来 ...
- PCL—点云分割(基于凹凸性) 低层次点云处理
博客转载自:http://www.cnblogs.com/ironstark/p/5027269.html 1.图像分割的两条思路 场景分割时机器视觉中的重要任务,尤其对家庭机器人而言,优秀的场景分割 ...
- PCL—点云分割(最小割算法) 低层次点云处理
1.点云分割的精度 在之前的两个章节里介绍了基于采样一致的点云分割和基于临近搜索的点云分割算法.基于采样一致的点云分割算法显然是意识流的,它只能割出大概的点云(可能是杯子的一部分,但杯把儿肯定没分割出 ...
- VS2010 MFC中 窗口分割的实现
分割窗口概述 分割窗口,顾名思义,就是将一个窗口分割成多个窗格,在每个窗格中都包含有视图,或者是同一类型的视图,或者是不同类型的视图. MFC分割窗口的方式有两种,动态分割和静态分割. 动态分割窗口通 ...
随机推荐
- C#Windows窗体中添加了AxWindowsMediaPlayer的详细用法影响键盘操作的问题
最近在写一个飞机大战游戏,但在为游戏背景添加声音的时候,发现添加了AxWindowsMediaPlayer的详细用法音乐控件不能再通过键盘控制飞机的移动了,在网上查了许久,没找到原因,差点就想去找老师 ...
- Lua 语言基本语法
第一个 Lua 程序 .交互式编程 Lua 提供了交互式编程模式.我们可以在命令行中输入程序并立即查看效果. Lua 交互式编程模式可以通过命令 lua -i 或 lua 来启用 .脚本式编程 我们可 ...
- Javascript时间戳和日期时间的相互转换
跟后台对接的时候经常碰到时间格式的问题,有时返回的是时间戳,有时返回的是具体时间,需求又需要它们之间的转换,所以干脆把之前遇到过的情况都给记录下来,以供自己参考! 本文备注:(时间戳单位为毫秒ms,换 ...
- cout关闭输出缓冲,调试用
cout.setf(std::ios::unitbuf);
- Python之路,Day9 - 异步IO\数据库\队列\缓存
https://www.cnblogs.com/alex3714/articles/5248247.html http://www.cnblogs.com/wupeiqi/articles/51327 ...
- @lazy注解处理循环注入问题
@Service public class A extends GenericBaseService { @Autowired private B b; } @Service public class ...
- 重构 改善既有代码的设计 Replace Method with Method Object(以函数对象取代函数)
你有一个大型函数,其中对局部变量的使用使你无法采用Extract Method. 将这个函数放进一个单独对象中,如此一来局部变量就成了对象内的字段.然后你可以在同一个对象中将这个大型函数分解为多个小型 ...
- css.1
background-repeat背景平铺background-x水平平铺 background-y垂直平铺 background:url()no-repeat;不平铺 background-size ...
- 外网访问SQLServer数据库holer实现
外网访问内网SQLServer数据库 内网主机上安装了SQLServer数据库,只能在局域网内访问,怎样从公网也能访问本地SQLServer数据库? 本文将介绍使用holer实现的具体步骤. 1. 准 ...
- js中css样式
1.js操作css样式 例如 div . style . width=“100px”. 就是在div标签内我们添加一个style属性,并设定了width值,这种写法会给标签带来大量的style属性,跟 ...