随机采样一致分割法,从点云中分割出线、面等几何元素

#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
(2) SACMODEL_LINE(三维直线)
  • 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
     
(3) SACMODEL_CIRCLE2D(二维圆)
  • 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
(4) SACMODEL_CIRCLE3D
  • 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
(6) SACMODEL_CYLINDER(柱)
  • 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
(7) SACMODEL_CONE 
  • not implemented yet
(8) SACMODEL_TORUS
  • 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.

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
(10) SACMODEL_PERPENDICULAR_PLANE

  • 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

(12) SACMODEL_NORMAL_PLANE

  • 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);
...

(13) SACMODEL_PARALLEL_PLANE

  • a model for determining a plane parallel to an user-specified axis, within a maximim specified angular deviation. SACMODEL_PLANE.

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分割支持的几何模型的更多相关文章

  1. 基于传统方法点云分割以及PCL中分割模块

      之前在微信公众号中更新了以下几个章节 1,如何学习PCL以及一些基础的知识 2,PCL中IO口以及common模块的介绍 3,PCL中常用的两种数据结构KDtree以及Octree树的介绍    ...

  2. PCL—点云分割(RanSaC)低层次点云处理

    博客转载自:http://blog.csdn.net/app_12062011/article/details/78131318 点云分割 点云分割可谓点云处理的精髓,也是三维图像相对二维图像最大优势 ...

  3. PCL点云分割(1)

    点云分割是根据空间,几何和纹理等特征对点云进行划分,使得同一划分内的点云拥有相似的特征,点云的有效分割往往是许多应用的前提,例如逆向工作,CAD领域对零件的不同扫描表面进行分割,然后才能更好的进行空洞 ...

  4. PCL点云分割(3)

    (1)Euclidean分割 欧几里德分割法是最简单的.检查两点之间的距离.如果小于阈值,则两者被认为属于同一簇.它的工作原理就像一个洪水填充算法:在点云中的一个点被“标记”则表示为选择在一个的集群中 ...

  5. PCL中的OpenNI点云获取框架(OpenNI Grabber Framework in PCL)

    从PCL 1.0开始,PCL(三维点云处理库Point Cloud Library)提供了一个通用采集接口,这样可以方便地连接到不同的设备及其驱动.文件格式和其他数据源.PCL集成的第一个数据获取驱动 ...

  6. kd-tree理论以及在PCL 中的代码的实现

    (小技巧记录:博客园编辑的网页界面变小了使用Ctrl  ++来变大网页字体) 通过雷达,激光扫描,立体摄像机等三维测量设备获取的点云数据,具有数据量大,分布不均匀等特点,作为三维领域中一个重要的数据来 ...

  7. PCL—点云分割(基于凹凸性) 低层次点云处理

    博客转载自:http://www.cnblogs.com/ironstark/p/5027269.html 1.图像分割的两条思路 场景分割时机器视觉中的重要任务,尤其对家庭机器人而言,优秀的场景分割 ...

  8. PCL—点云分割(最小割算法) 低层次点云处理

    1.点云分割的精度 在之前的两个章节里介绍了基于采样一致的点云分割和基于临近搜索的点云分割算法.基于采样一致的点云分割算法显然是意识流的,它只能割出大概的点云(可能是杯子的一部分,但杯把儿肯定没分割出 ...

  9. VS2010 MFC中 窗口分割的实现

    分割窗口概述 分割窗口,顾名思义,就是将一个窗口分割成多个窗格,在每个窗格中都包含有视图,或者是同一类型的视图,或者是不同类型的视图. MFC分割窗口的方式有两种,动态分割和静态分割. 动态分割窗口通 ...

随机推荐

  1. 『TensorFlow』读书笔记_进阶卷积神经网络_分类cifar10_上

    完整项目见:Github 完整项目中最终使用了ResNet进行分类,而卷积版本较本篇中结构为了提升训练效果也略有改动 本节主要介绍进阶的卷积神经网络设计相关,数据读入以及增强在下一节再与介绍 网络相关 ...

  2. 【Oracle】【8】大批量update某个字段

    正文: 需实现:将A表的某个字段的值复制到B表中 我们一般会这样写:UPDATE B SET B.NAME = (SELECT A.NAME FROM A WHERE A.NO = B.NO) 出现的 ...

  3. 完美解决xhost +报错: unable to open display "" 装oracle的时候总是在弹出安装界面的时候出错

    详细很多朋友在装oracle的时候总是在弹出安装界面的时候出错,界面就是蹦不出来. oracle安装 先切换到root用户,执行xhost + 然后再切换到oracle用户,执行export DISP ...

  4. MySQL 导出用户权限

    Version <= 5.6 #!/bin/bash #Function export user privileges source /etc/profile pwd=****** expgra ...

  5. 【协议逆向工程】Part 1 概述

    1 协议逆向工程概述 1.1 协议 协议是计算机网络与分布式系统中各种通信实体键相互交互信息时必须遵守的一组规则和约定,这些规则明确规定了所交换的数据格式以及有段的同步问题,从而保证了双方通信有条不紊 ...

  6. SQL DELETE 语句详解

    SQL DELETE 语句详解   DELETE 语句 DELETE 语句用于删除表中的行. 语法 DELETE FROM 表名称 WHERE 列名称 = 值 Person: LastName Fir ...

  7. static静态全局变量和static静态局部变量

    static静态全局变量: 静态全局变量就是将全局变量变成静态的.如何变?——全局变量加个static. static就是一个存储类说明符,a这个全局变量就成了一个静态全局变量了. 静态全局变量的特点 ...

  8. chrome扩展应用实例

    chrome extensions 基本组成,唯一必要的文件就是manifest.json这个应用的配置清单 manifest.json中前三个参数为必要参数,其他的可选: { "name ...

  9. leetcode python 009

    ##懒得自己做 ##  验证回文数字int0=63435435print(int(str(int0)[::-1])==int)

  10. Pycharm中flask框架应用

    flask框架应用实例 get方法 服务器端 server.py 如下 import flask app=flask.Flask(_name_) //启动一个应用程序 @app.rout(" ...