Question

How to detect a thumb in specific on a Leap Motion device?

Also is there any way that I find a 'Fist' gesture. I want to integrate the code with my project.

Or is should I develop my own algorithm entirely?

Était-ce utile?

La solution 2

Using latest leap motion SDK this is a pretty easy task. You can use finger "type" property to identify the finger.

Assuming that you already have obtained a finger object, you can get its finger type property using

finger_type = finger.type

Since you are looking to identify the thumb, you want finger_type = 0.

For more details, refer to the leapmotion documentation.

Autres conseils

A hand with no detected fingers is most likely a fist.

You can use the thumb angle, length, width and base position to distinguish it from the other digits. For example, the thumb is usually shorter than the other fingers, except the pinky -- but it is usually wider than the pinky. The base position, which you can calculate from the tip position, length and direction, is in a much different position relative to the other digits. You can use facts like these to develop heuristics for identifying the thumb. Granted, it isn't an easy task.

Both tasks should be much easier soon when the Leap Motion API will provide identification of the fingers and possibly simple poses like grasp and pinch.

[edit] This applies only to the old, v1 version of tracking. The new version always reports positions for five fingers per hand. Thumbs (and the other digits) are now identified with the Type attribute. For detecting a fist you can use GrabStrength or check the IsExtended property of all the fingers.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top