Leap Motion 再其视野内设备追踪hands, fingers, and tools,它提供了一系列数据集合 frame 的更新。每个frame都包含基本的跟踪数据,如hands, fingers, and tools,以及识别出的Gestures和整个场景中motion元素的描述 。 当它检测到a hand, finger, tool, or gesture, Leap Motion 软件为它分配一个唯一的ID指示符。只要该实体保持设备的视野内可见,其ID保持不变。如果跟踪丢失后收复, Leap Motion 软件可能会分配一个新的ID(该软件可能无法分辨现在可见的手或手指与丢失前是一样的)。
一个Frame对象提供跟踪数据,gestures,和motion的特征描述。
Pointables, Fingers, and Tools:3个pointables lists包含frame中检测到所有pointable对象。您可以通过在hand list的中hand的对象,访问与hand相关联的pointables。请注意,如果用户的手仅部分在Leap Motion 的视野之内的情况下, Fingers and Tools可能就与hand对象无关。
如果你正在跟踪某个独立的对象,如a finger,您可以在frame中通过使用与该对象相关联的ID来查看。你还可以通过ID查看Hand, Finger, Tool, Pointable, and Gesture objects。如果它存在于当前frame,查找函数返回一个相应对象的引用。如果对象不再存在,那么返回一个特殊的无效对象。无效的对象是明确定义的,但不包含有效的跟踪数据。当你必须访问Leap Motion跟踪数据时,这项技术有助于减少NULL检查。
Leap Motion 软件分析之前frame发生的整体运动来合成 translation, rotation, and scaling。例如,如果在Leap Motion视野中,你将双手向左侧移动,表示translation; 如果你扭动你的手,像转动一个球,代表rotation; 如果将你的双手靠近或远离,代表scaling。Leap Motion软件在分析运动时,会使用视野内的对象。如果只检测一只手,Leap Motion检测的所有frame motion factors都基于那只手的运动。如果它检测到两只手,然后 Leap Motion软件分析双手的frame motion factors。您还可以从每只手对象得到独立 frame motion factors 。
frame motion是通过比较当前frame与先前指定的frame的运动而派生。合成motion的属性描述包括:
Frame motion框架包含了在frame中对motion为某一种特定类型运动的估计。例如,如果Scale概率是最高的,那么你可以忽略在frame中的任何rotations or translations (如果它对于你的应用程序是合理的)。使用概率估计过滤不必要的motions可以使应用程序更易于使用。
Hand model提供与手相关的信息包括:位置,特性,和检测到的以及与手的相关联的 fingers and tools lists。
Leap Motion API提供关于一只手尽可能多的信息。然而, Leap Motion 软件可能无法确定所有的手在每一帧中的属性。例如,当一只手攥成一个拳头,手指是不可见的,所以 Leap Motion的手指列表将是空的。当模型不提供某一个属性,你的代码应该处理这种情况。
Leap Motion 软件并不能确定是否有手是左手或右手。如果视野中出现不止一个人的手或其他手状物体,则可以出现在两个以上的手列表。不过,我们建议在Leap Motion视野中最多两只手,以保持最佳的运动跟踪质量。
hand object提供被检测手的几个属性:
The direction and palmNormal是描述手方向的单位向量符合Leap Motion坐标系
The normal vector points perpendicularly out of the hand; the direction vector points forward.(与法线垂直的方向向量指向前方)
The sphereCenter and sphereRadius 描述一个适应人手曲率的球的尺寸。
The size of the sphere decreases as the fingers are curled.(球的尺寸随着手的卷曲而变化)
Hand Object还提供了几个属性,报告检测手在帧之间的运动。 Leap Motion 软件分析hand的运动,以及与其相关联的手指和工具,得出平移,旋转,和缩放。移动你的手产生平移。转动,扭曲,倾斜你的手产生旋转。彼此朝向或远离移动的手指或工具产生缩放。
Hand motions来自在当前帧中的手的特性与先前指定的帧的比较。合成的motion的属性描述包括:
Hand Object包括对motion估计为一个特定类型的运动的估计。例如,如果Scale概率是最高的,那么你可以忽略在帧中的任何旋转或平移(如果它对于你的应用程序是合理的)。使用概率估计过滤不必要的motions可以使应用程序更易于使用。
你可以访问与手相关的手指和工具,用以下的三个列表:
您还可以通过在前一frame中获得的ID值找到一个单独的 finger or tool。使用 Hand::finger(),Hand::tool(),如果你不需要区分fingers and tools ,可以使用 Hand::pointable()函数。这些函数如果在当前frame中存在,则它返回一个相应对象的引用。如果 fingers and tools 与hand object 在该frame中是不相关的,则返回一个无效的对象。
Leap Motion设备检测和跟踪在其视野中的fingers and tools 。 Leap Motion软件根据形状区分手指状的物体。tool是更长,更薄,比手指直。 在 Leap Motion model, fingers and tools 的物理特性被抽象成 a Pointable object 。 Fingers and tools 都是pointable类型对象。pointable对象的物理特性包括:
Finger tipPosition and direction vectors provide the positions of the finger tips and the directions in which the fingers are pointing.( tipPosition and direction vectors 向量将提供指尖的位置和手指的方向)
Leap Motion 软件将一个检测到的pointable object区分为 a finger 或 a tool 。使用Pointable:: isTool()函数来确定a Pointable object代表哪一类 。
A tool is longer, thinner, and straighter than a finger.(tool比 finger是更长,更薄,更直。)
The Leap Motion软件识别某些特定的运动模式,表明一个用户意图或命令的手势。 The Leap Motion 软件在frame将识别出的运动模式呈现为Gestures,以fingers and hands同样的方式,报告和其他动作的跟踪数据。对于观察到的每个 gestures, The Leap Motion software 为frame增加了一个Gesture object。你可以从gestures list得到这些 Gesture objects 。
以下是 The Leap Motion识别的的运动模式:
当 Leap Motion software 软件首先分类出一种gesture,它为frame增加了一个 Gesture object。如果gesture持续, Leap Motion 添加更新后的 Gesture objects到后续frame。 The gestures Circle and Swipe 动作是连续的。 Leap Motion software 更新gesture 每一帧的状态。tap是离散的手势。 Leap Motion software 呈现单独Gesture object的每个tap。
Important: 在你应用中使用gestures之前,必须能够先识别 gestures, Controller class拥有an enableGesture() method ,使你可以使用识别你使用的 gestures.
The Leap Motion software将a finger在空间中的圆形运动轨迹识别为a Circle gesture.
A circle gesture with the forefinger.
你可以通过finger or tool来实现一个circle. Circle gestures是连续的。一旦这个gesture开始,the Leap Motion software将会持续更新这个过程,直到gesture结束。当画圆的finger or tool离开圆或运动过慢时,a circle gesture结束。
可以通过API中的 CircleGesture来查看更多信息。
The Leap Motion software将a finger的线性移动识别为a Swipe gesture.
A horizontal swipe gesture.
你可以通过任何finger在任何方向来实现a swipe gesture. Swipe gestures是连续的。一旦这个gesture开始,the Leap Motion software将会持续更新这个过程,直到gesture结束。当finger or tool改变运动方向或运动过慢时,a swipe gesture结束。
可以通过API中的SwipeGesture来查看更多信息。
The Leap Motion software能够识别两种taps: 向下的 Key Tap 以及向前的Screen Tap.
The Leap Motion software将a finger or tool 一个向下的快速运动识别为a Key Tap gesture.
A key tap gesture with the forefinger.
你可以通过像弹钢琴键一样通过向下运动来实现a key tap gesture. Tap gestures是离散的。每个tap gesture都被添加到一个单独对象中。
可以通过API中的 KeyTapGesture来查看更多信息。
The Leap Motion software将a finger or tool一个快速向前的运动识别为a Screen Tap gesture.
A screen tap gesture with the forefinger.
你可以通过像点击虚拟和按压触屏一样,通过向前运动来实现a screen tap gesture. Tap gestures是离散的。每个tap gesture都被添加到一个单独对象中。
可以通过API中的ScreenTapGesture来查看更多信息。
联系客服