我想检查Leap Motion Frame中的手是否当前是拳头。用Leap Motion SDK V2检测拳头
通常建议的方法是寻找值为1的hand.grabStrength
。问题是,即使使用“爪状手”或任何其他手指略微卷曲的值,该值也跳到1。
另一种方法是检查每个手指是否为extended
。但是这有一个类似的问题,如果手指完全直线,手指只能算作延伸。所以即使我检查所有的手指都没有伸展,也会出现与上面相同的问题(爪状手被识别为抓取)。
结合这两种方法也不能解决这个问题,考虑到它们都遭受同样的问题,这并不令人惊讶。
现在,我们确实拥有每个手指的所有骨骼,包括位置和一切。但我不知道从数学开始检测手指是否卷曲。
基本上我有这个设置现在:
var controller = Leap.loop(function(frame){
if(frame.hands.length>0){
//we only look at the first available hand
var hand = frame.hands[0];
//we get the index finger only, but later on we should look at all 5 fingers.
var index = hands.fingers[1];
//after that we get the positions of the joints between the bones in a hand
//the position of the metacarpal bone (i.e. the base of your hand)
var carp = index.carpPosition;
//the position of the joint on the knuckle of your hand
var mcp = index.mcpPosition;
//the position of the following joint, between the proximal and the intermediate bones
var pip = index.pipPosition;
//the position of the distal bone (the very tip of your finger)
var dip = index.dipPosition;
//and now we need the angle between each of those positions, which is where i'm stuck
}
});
那么,如何才能获得其中的两个位置之间的夹角(鲤鱼MCP,MCP,以画中画,PIP沾)?有任何想法吗?
这是否也会使手指在关节处断裂,指向需要的角度方向相反的方向做一个拳头(好像完全不受关节范围的限制)? :d。 * cringe * – 2014-10-30 14:11:29
我想这会,但是这个数学对我来说有点太复杂。 :P – DodgerThud 2014-10-30 14:17:27
我发现一个很好的解决方案,使用每个手指和手掌之间的距离。计算这些距离的总和并检查它是否低于某个阈值。 – whoabackoff 2015-04-27 19:14:37