专 业 学 位 硕 士 学 位 论 文 人体动作捕捉系统软件设计 Software Design of Human Motion Capture System 作 者 姓 名: 陈义新 工 程 领 域: 控制工程 学 号: 31509071 指 导 教 师: 王哲龙 教授 完 成 日 期: 2017年4月 25日 大连理工大学 Dalian University of Technology
大连理工大学学位论文独创性声明 作者郑重声明:所呈交的学位论文,是本人在导师的指导下进行研究工作所取得的成果。尽我所知,除文中已经注明引用内容和致谢的地方外,本论文不包含其他个人或集体已经发表的研究成果,也不包含其他已申请学位或其他用途使用过的成果。与我一同工作的同志对本研究所做的贡献均已在论文中做了明确的说明并表示了谢意。 若有不实之处,本人愿意承担相关法律责任。
大连理工大学专业学位硕士学位论文 - I - 摘 要 动作捕捉技术涉及惯性导航、通讯、人体工程学、计算机图形学等多个交叉学科。近年来,随着传感器技术的发展,惯性导航技术的革新和计算硬件水平的不断提高,动作捕捉技术得到了飞快发展。动作捕捉在国内外均发展到一定水平,无论是高校研究所还是企业都对动作捕捉领域进行了深度探索,市场上出现了性能稳定的商业化产品。现已经在医疗、影视制作、虚拟现实等领域有着广泛的应用。比如在大型的3D游戏制作过程中,已经将光学运动捕获技术和虚拟现实技术完美结合,做出非常真实的人物的动画效果。在影视制作领域,《角斗士》和《魔界》等脍炙人口的电影都大量的使用了人体运动捕获技术,从而使里面的角色更加逼真,赋有生命力。 本文涉及的人体动作的捕捉系统的整体框架由下位机和上位机组成。下位机为分布在全身的传感节点,实时将传感节点的数据,通过无线模块,发送给PC。上位机软件平台运行在PC上,PC通过无线天线实时接收个传感节点的数据,软件平台分析并处理这些数据,将解算出的人体姿态实时重构为计算机图形,对人体动作在虚拟的3D场景中实时重构。 本文基于微型惯性传感器技术,结合惯性导航原理,通过应用数据融合算法、计算机图形学相关原理和技术以及相应的编程技术,最终设计完成了人体姿态捕捉系统软件平台。该软件系统平台主要实现了对多个传感节点发送的数据包进行实时接收,数据包进行拆包以及数据的预处理;运用了数据融合算法,对多个传感器数据的进行融合,完成了人体姿态的解算。使用四元数描述人体姿态并完成对人体模型实时驱动,进而完成人体动作重构。 本文针对人体的运动规律和人体结构进行了相关研究,并且简化了人体模型。为了使人体动作重构的效果逼真且计算量小,本文采用了蒙皮骨骼动画技术。为了使该软件系统能够在Windows系统下,能够良好的运行,本文选择了DirectX图形界面库与MFC框架结合作为软件的基本框架。调用了DirectX界面库的相应接口,完成了3D人体模型的加载。将人体各个肢体在导航系的坐标转换为屏幕坐标,完成对人体模型的驱动。从最终的演示动作捕捉效果来看,人体动作跟踪效果良好。 关键词:惯性传感器;惯性导航;数据融合;动作捕捉
人体动作捕捉系统软件设计 - II - Software Design of Human Motion Capture System Abstract Motion capture technology involves many disciplines, such as inertial navigation, communication, human engineering, computer graphics and so on. In recent years, with the development of sensor technology, the innovation of inertial navigation technology and the improvement of hardware level, motion capture technology has developed rapidly. Motion capture has developed to a certain level both at home and abroad. Both university research institutes and enterprises have explored the field of motion capture deeply, and commercial products with stable performance have appeared on the market. It has been widely used in medical, film and television production, virtual reality and other fields. For example, in the process of making large 3D games, optical motion capture technology and virtual reality technology have been combined perfectly to make animated characters of very real characters. In the field of film and television production, "Gladiator" and "demon zone" and other popular movies are a lot of use of human motion capture technology, so that the role of the more realistic and endowed with vitality. The whole framework of the human action capture system is composed of the lower computer and the host computer. The lower computer is the sensing node distributed in the whole body, and the data of the sensor nodes are sent to PC in real time by wireless module. The PC software platform running on PC, PC through the wireless communication technology to receive real-time sensing node data analysis software platform and the data processing, real-time reconstruction of human posture will be calculated for computer graphics, real-time reconstruction of human motion in the virtual scene in 3D. This paper, based on micro inertial sensor technology, combination of the principle of inertial navigation, through the application of data fusion algorithm, computer graphics principle and technology as well as the corresponding programming technology, finally completed the design of human gesture capture system software platform. The software system mainly realizes the multiple sensor nodes to send data packets for real-time packet receiving, unpacking and preprocessing of data; using a data fusion algorithm, the fusion of multiple sensor data, complete the calculation of human body posture. The human body is represented by four variables, and the human model is driven in real time, and then the human motion is reconstructed. In this paper, the movement of human body and the structure of human body are studied, and the model of human body is simplified. In order to make the human movement reconstruction more realistic and less computational, this paper uses skin skeleton animation
大连理工大学专业学位硕士学位论文 - III - technology. In order to make the software system run well under the Windows system, this paper chooses the DirectX graphical interface library and the MFC framework as the basic framework of the software. The corresponding interface of the DirectX interface library is called, and the loading of the 3D human model is completed. The coordinates of the human body in the navigation system are converted into screen coordinates to drive the human body model. From the final demonstration of the action capture effect, the body tracking effect is good. Key Words:Inertial Sensor; Inertial Navigation; Data Fusion; Motion Capture
人体动作捕捉系统软件设计 - IV - 目 录 摘 要 ............................................................................................................................. I Abstract ............................................................................................................................. II 1 绪论 .............................................................................................................................. 1 1.1 研究背景和意义 ............................................................................................... 1 1.2 国内外发展概况 ............................................................................................... 4 1.2.1 国外现状 ................................................................................................ 4 1.2.2 国内现状 ................................................................................................ 5 1.3 本文主要工作及论文结构安排 ....................................................................... 7 2 人体动作姿态解算基本原理 ...................................................................................... 8 2.1 惯性导航中常用的坐标系 ............................................................................... 8 2.2 坐标变换和姿态角的确定 ............................................................................. 10 2.3 姿态解算的基本方法 ..................................................................................... 13 2.3.1 欧拉角法 .............................................................................................. 13 2.3.2 方向余弦法 .......................................................................................... 14 2.3.3 四元数法 .............................................................................................. 15 2.4 本章小结 ......................................................................................................... 18 3 传感器误差分析与数据预处理 ................................................................................ 19 3.1 陀螺仪误差建模以及处理 ............................................................................. 19 3.1.1 陀螺仪误差建模以及补偿 .................................................................. 19 3.1.2 陀螺仪数据处理 .................................................................................. 20 3.2 加速度计误差建模以及处理 ......................................................................... 22 3.2.1 加速度计误差建模 .............................................................................. 22 3.2.2 加速度计误差标定 .............................................................................. 22 3.2.3 加速度噪声处理 .................................................................................. 23 3.3 磁力计误差建模与补偿 ................................................................................. 24 3.3.1 磁力计误差建模 .................................................................................. 25 3.3.2 磁力计误差补偿 .................................................................................. 25 3.4 本章小结 ......................................................................................................... 27 4 三维层次人体模型的建立 ........................................................................................ 28 4.1 人体模型的分类 ............................................................................................. 28 4.2 实时角色动画分类 ......................................................................................... 29
大连理工大学专业学位硕士学位论文 - V - 4.2.1 关节动画 .............................................................................................. 29 4.2.2 网络动画 .............................................................................................. 30 4.2.3 蒙皮骨骼动画 ...................................................................................... 30 4.3 人体模型层次分析 ......................................................................................... 31 4.4 人体模型的建立 ............................................................................................. 32 4.5 本章小结 ......................................................................................................... 33 5. 人体动作捕捉算法设计 ........................................................................................... 34 5.1 加速计和磁力计解算姿态 ............................................................................. 34 5.2 基于互补滤波器的数据融合算法 ................................................................. 36 5.3 基于梯度下降法的数据融合算法 ................................................................. 39 5.4 基于卡尔曼滤波的数据融合法 ..................................................................... 42 5.5 本章小结 ......................................................................................................... 44 6. 系统软件平台设计 ................................................................................................... 45 6.1 软件的开发环境 ............................................................................................. 45 6.2 系统软件平台总体设计 ................................................................................. 46 6.3 软件平台详细设计 ......................................................................................... 47 6.3.1 数据的接收与保存 .............................................................................. 47 6.3.2 DirectX环境的初始化 ........................................................................ 49 6.3.3 人体模型的加载 .................................................................................. 50 6.3.4 人体模型的驱动 .................................................................................. 51 6.4 系统软件平台测试 ......................................................................................... 53 6.4.1 软件界面与功能 .................................................................................. 53 6.4.2 动作捕捉效果演示 .............................................................................. 53 6.5 本章小结 ......................................................................................................... 54 结 论 .......................................................................................................................... 55 参 考 文 献 .................................................................................................................... 56 致 谢 .......................................................................................................................... 59 大连理工大学学位论文版权使用授权书 ...................................................................... 60
大连理工大学专业学位硕士学位论文 - 1 - 1 绪论 1.1 研究背景和意义 人体运动捕捉是指将光学标定点、惯性传感器等跟踪器放置在能够明显反映人体运动的关键部位,由动作捕捉系统实时获取跟踪器位置,获得表演者运动的信息后,经过数据解析得到人体肢体的三维空间坐标,在计算机虚拟环境中将人体的运动过程再现。主要涉及到惯性导航、通讯、人体工程学、计算机图形学等学科的综合性技术。 人体动作捕捉系统按原理可以分为以下几种类型: (1) 机械式动作捕捉:这种动作捕捉系统依赖机械装置来实时跟踪表演者的运动轨迹。其优点是设备的成本比较低,精度也比较高,能够完成实时动作捕捉的任务要求。具备其它类型的捕捉系统不具备的多个角色可以同时表演的功能。同时也具有操作不便,表演者的动作受到机械结构约束限制等缺点。 (2) 声学式动作捕捉:常见的声学式运动捕捉装置一般由声波发送器、声波接收器和处理单元三部分组成。其优势是系统成本比较低,但同时捕捉实时性差,精度也不会太高。而且系统最大的不足之处在于该系统对捕捉环境要求高,声源和接收器间应尽量避免物体遮挡,易受外界声音的干扰。需要对影响声音在空气中传播速度的气压和温度等因素,做出相应的补偿。在实际应用中,这种动作捕捉方式已经很少使用。 (3) 电磁式动作捕捉:这种运动捕捉方式是比较常用动作捕捉系统之一。表演者穿戴接收传感器在电磁发射装置产生的磁场中运动,接收传感器测量磁场的变化,计算各个传感器的空间位置,完成捕捉。其优势是记录的信息维数较多,可以同时获得位置和方向。无论是系统的实时性还是采样频率,还是系统的稳定性都比较高。其缺点也比较明显,系统对捕捉环境的磁场要求比较严格,环境中金属物品或者其他磁性物质会对捕捉效果造成干扰。系统是一种有线的传输方式,限制了捕捉的活动范围,使系统很难在比较剧烈的运动的场合使用。 (4) 光学式动作捕捉:其基本原理为在捕捉场景中不同方位放置多个光学相机,发出不同角度红外光,红外光经过动作表演者身上特殊反光材料的Marker点的反射,形成不同的灰度,通过识别不同的灰度来分辨出多个Marker点,从而完成对表演者的运动和动作实时跟踪。其优势在于装置无电缆和机械结构的限制,Marker点可以灵活的固定在表演者的各个部位,这使表演者活动范围大,可以自由地表演,也可以捕捉到其他捕捉系统无法捕捉的特殊位置,如人的面部表情。由于其采样速率极高,与其他方式的动作捕捉系统相比,可以捕捉高速运动的目标。系统规模可以调整,Marker点数量可根据具体应用灵活调整。该系统的缺点为光学动作捕捉相机价格相对昂贵,对捕捉视场内