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分割窗口的方式有两种,动态分割和静态分割. 动态分割窗口通 ...
随机推荐
- vs2015 ncnn
1.vs2015编译器编译protobuf (VS2015 x64本机工具命令) 下载源码:https://github.com/google/protobuf/archive/v3.4.0.zi ...
- python实现以application/json格式为请求体的http post请求
接口传递数据格式类型为json格式,如下图抓包查看 Python实现脚本请求接口并以中文打印接口返回的数据 import json import requests url = "https: ...
- js中Undefined 和 Null的区别
Undefined 和 Null Undefined 这个值表示变量不含有值. 可以通过将变量的值设置为 null 来清空变量. <!DOCTYPE html> <html> ...
- 5、SAMBA服务二:配置实例
①:SAMBA服务一:参数详解 ②:SAMBA服务二:配置实例 5.2.3.Samba共享目录配置实例 1.允许匿名用户读取/it共享目录,修改/etc/samba/smb.conf,在最后添加以下内 ...
- 移动端解决悬浮层(悬浮header、footer)会遮挡住内容的方法
固定Footer Bootstrap框架提供了两种固定导航条的方式: ☑ .navbar-fixed-top:导航条固定在浏览器窗口顶部 ☑ .navbar-fixed-bottom:导航条固定在 ...
- js里获取页面高度和文档高度
$(window).height() 和 $(document).height()的区别 $(window).height()代表了当前可见区域的大小,$(document).height()则代表了 ...
- Spring Security Oauth2 单点登录案例实现和执行流程剖析
Spring Security Oauth2 OAuth是一个关于授权的开放网络标准,在全世界得到的广泛的应用,目前是2.0的版本.OAuth2在“客户端”与“服务提供商”之间,设置了一个授权层(au ...
- 【阅读笔记】《C程序员 从校园到职场》第六章 常用文件操作函数 (Part 1)
参考链接:https://blog.csdn.net/zhouzhaoxiong1227/article/details/24926023 让你提前认识软件开发(18):C语言中常用的文件操作函数总结 ...
- chrome扩展应用API
background scripts可以访问所有的 WebExtension JavaScript APIs ,但是不能直接访问页面 content scripts 可以通过标准的DOM api 读取 ...
- OC关于项目里面的代码统计次数
备注:这里只是个人的观点,有的地方也是copy,多多指教,个人笔记,有侵犯你们版权的地方还望海涵!!! 1.打开终端 2.cd 进入项目根目录 3.输入命令 find . "(" ...