LeapMotion Demo2

本文分享了使用LeapMotion API进行握拳手势识别的过程及技巧。通过计算手指弯曲角度、利用Hand抓取力度等方法,成功实现了握拳状态的识别,并在程序中直观展示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

   官方doc有四个手势,最近尝试实现对握拳的识别,并能在我的程序界面上体现出来。


   调试过程较为繁琐,幸好最终效果还差强人意! 首先看看我的效果图:

      

 该图实时显示我握拳、松开的过程。



 部分问题解决还是比较痛苦的。  我尝试了多种方式,但过程有时候比结果其实更重要,幸好LeapMotion的API 识别出的数据比较完善。


Tip One: 计算弯曲角度。


1. measure the distance between a fingers stabilized point and the palms stabilized point
2. use that distance to calculate the angle at one end of a triangle

3.you can use those angles and lengths to work out lots of other lengths..


Tip Two: 根据API判断手指是否弯曲。



Tip Three:根据API 提供的Hand 抓取力度判断。

float GrabStrength

The strength of a grab hand pose.

The strength is zero for an open hand, and blends to 1.0 when a grabbing hand pose is recognized.

float strength = hand.GrabStrength;
Return
A float value in the [0..1] range representing the holding strength of the pose.
Since
2.0
Tip Four:计算指尖与掌心的位置。
 ----- 该方式我尝试了,也实现了我需要的效果,只是误差概率较大。也有可能是我实现过程有问题。

Tip :有一些给我提供了想法的链接:

https://stackoverflow.com/questions/26649941/detecting-a-fist-with-leap-motion-sdk-v2 

        https://developer-archive.leapmotion.com/gallery/finger-angle

        https://developer-archive.leapmotion.com/gallery/finger-angle-signed

        http://blog.youkuaiyun.com/qq_31411825/article/details/54773801

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DuelCode

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值