点云处理(基于Open3D)

本文深入探讨了点云处理的基本概念,包括Roll、Yaw、Pitch的定义及其在摄像机位姿描述中的应用,点云格式如PLY和PCD的解析。详细介绍了RANSAC算法的工作原理和在直线拟合中的应用,以及ICP算法在点云配准中的求解步骤。涵盖了点云数据的局限性、配准方法和误差分析。

1. 基本概念

  • 深度图的局限性
    • 阳光下深度图有很多洞且深度值不准确
    • 镜面反射面的深度值不准确(如玻璃、镜子和大理石地面)
  • 点云的用途:
    • 点云数据能够以较小的存储成本获得物体准确的拓扑结构和几何结构,因而获得越来越广泛的关注。
    • 在实际的采集过程中,因为被测物体尺寸过大,物体表面被遮挡或者三维扫描设备的扫描角度等因素,单次的扫描往往得不到物体完整的几何信息。
    • 为了获得被测物体的完整几何信息,就需要将不同视角即不同参考坐标下的两组或者多组点云统一到统一坐标系下,进行点云的配准。
    • 点云配准
      • 目标:根据原始点云和目标点云,通过配准求出变换矩阵,即旋转矩阵R和平移矩阵T,并计算误差以评估匹配结果
      • 配准方法
        • 基于局部特征描述子(PFH、FPFH、3Dsc、Shot等)
        • ICP
        • NDT(基于概率分布)
      • 配准的一般步骤
        • 提取关键点
        • 特征描述
        • 一致性估计(精配准)
        • 精配准
        • 误差分析

1.1 Roll(翻滚)、Yaw(偏航)、Pitch(俯仰)

  • Roll、Yaw、Pitch本是航空术语, 现常用于描述摄像机的位姿
  • 把摄像机看成一个飞机,镜头朝向就是飞机头的朝向
    • Roll:翻滚,就是绕着机身所在的那个轴旋转 (机身为旋转轴)
    • Yaw:偏航,如果要改变航向,飞机必定是绕着重力方向为轴旋转 (重力为旋转轴)
    • Pitch:倾斜、坠落、俯仰,飞机在坠落时,必定会一头栽下去,以翅膀所在的直线为轴 (翅膀为旋转轴)
  • 不同摄像机定义的坐标系不一样,只要与上述描述的意义对应即可
  • 摄像机的Roll、Yaw、Pitch
    在这里插入图片描述
    在这里插入图片描述

1.2 点云格式 (Point Cloud Format)

Format Description
xyz Each line contains [x, y, z], where x, y, z are the 3D coordinates
xyzn Each line contains [x, y, z, nx, ny, nz], where nx, ny, nz are the normals
xyzrgb Each line contains [x, y, z, r, g, b], where r, g, b are in floats of range [0, 1]
pts The first line is an integer representing the number of points.
Each subsequent line contains [x, y, z, i, r, g, b], where r, g, b are in uint8
ply See Polygon File Format, the ply file can contain both point cloud and mesh data
pcd See Point Cloud Data
Format Developer
PLY a polygon file format, developed at Stanford University by Turk et al
STL a file format native to the stereolithography CAD software created by 3D Systems
OBJ a geometry definition file format first developed by Wavefront Technologies
X3D the ISO standard XML-based file format for representing 3D computer graphics data
PCD Point Cloud Library (PCL)

1.2.1 PLY (多边形集合)

  • PLY:Polygon File Format
  • PLY文件:由多边形集合组成的图形对象(Graphical Objects)
  • 两种存储模式
    • ASCII模式
    • Binary模式
  • 典型的文件结构
    • 组成元素:顶点列表、面列表
  Header
  Vertex List
  Face List
  (lists of other elements)
  • 立方体描述1
ply
format ascii 1.0           {
   
    ascii/binary, format version number }
comment made by Greg Turk  {
   
    comments keyword specified, like all lines }
comment this file is a cube
element vertex 8           {
   
    define "vertex" element, 8 of them in file }
property float x           {
   
    vertex contains float "x" coordinate }
property float y           {
   
    y coordinate is also a vertex property }
property float z           {
   
    z coordinate, too }
element face 6             {
   
    there are 6 "face" elements in the file }
property list uchar int vertex_index {
   
    "vertex_indices" is a list of ints }
end_header                 {
   
    delimits the end of the header }
0 0 0                      {
   
    start of vertex list }
0 0 1
0 1 1
0 1 0
1 0 0
1 0 1
1 1 1
1 1 0
4 0 1 2 3                  {
   
    start of face list }
4 7 6 5 4
4 0 4 5 1
4 1 5 6 2
4 2 6 7 3
4 3 7 4 0
  • 立方体描述2
ply
format ascii 1.0
comment author: Greg Turk
comment object: another cube
element vertex 8
property float x
property float y
property float z
property uchar red                   {
   
    start of vertex color }
property uchar green
property uchar blue
element face 7
property list uchar int vertex_index  {
   
    number of vertices for each face }
element edge 5                        {
   
    five edges in object }
property int vertex1                  {
   
    index to first vertex of edge }
property int vertex2                  {
   
    index to second vertex }
property uchar red                    {
   
    start of edge color }
property uchar green
property uchar blue
end_header
0 0 0 255 0 0                         {
   
    start of vertex list }
0 0 1 255 0 0
0 1 1 255 0 0
0 1 0 255 0 0
1 0 0 0 0 255
1 0 1 0 0 255
1 1 1 0 0 255
1 1 0 0 0 255
3 0 1 2                           {
   
    start of face list, begin with a triangle }
3 0 2 3                           {
   
    another triangle }
4 7 6 5 4                         
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值