The Hand class reports the physical characteristics of a detected hand. More...
Inherits Interface.
Public Member Functions | |
| Arm | arm () const |
| The arm to which this hand is attached. More... | |
| Matrix | basis () const |
| The orientation of the hand as a basis matrix. More... | |
| float | confidence () const |
| How confident we are with a given hand pose. More... | |
| Vector | direction () const |
| The direction from the palm position toward the fingers. More... | |
| Finger | finger (int32_t id) const |
| The Finger object with the specified ID attached to this hand. More... | |
| FingerList | fingers () const |
| The list of Finger objects detected in this frame that are attached to this hand, given in order from thumb to pinky. More... | |
| Frame | frame () const |
| The Frame associated with this Hand. More... | |
| float | grabAngle () const |
| The angle between the fingers and the hand of a grab hand pose. More... | |
| float | grabStrength () const |
| Deprecated. More... | |
| Hand (HandImplementation *) | |
| Hand () | |
| Constructs a Hand object. More... | |
| int32_t | id () const |
| A unique ID assigned to this Hand object, whose value remains the same across consecutive frames while the tracked hand remains visible. More... | |
| bool | isLeft () const |
| Identifies whether this Hand is a left hand. More... | |
| bool | isRight () const |
| Identifies whether this Hand is a right hand. More... | |
| bool | isValid () const |
| Reports whether this is a valid Hand object. More... | |
| bool | operator!= (const Hand &) const |
| Compare Hand object inequality. More... | |
| bool | operator== (const Hand &) const |
| Compare Hand object equality. More... | |
| Vector | palmNormal () const |
| The normal vector to the palm. More... | |
| Vector | palmPosition () const |
| The center position of the palm in millimeters from the Leap Motion Controller origin. More... | |
| Vector | palmVelocity () const |
| The rate of change of the palm position in millimeters/second. More... | |
| float | palmWidth () const |
| The estimated width of the palm when the hand is in a flat position. More... | |
| float | pinchDistance () const |
| The distance between the thumb and index finger of a pinch hand pose. More... | |
| float | pinchStrength () const |
| Deprecated. More... | |
| Pointable | pointable (int32_t id) const |
| The Pointable object with the specified ID associated with this hand. More... | |
| PointableList | pointables () const |
| The list of Pointable objects detected in this frame that are associated with this hand, given in arbitrary order. More... | |
| float | rotationAngle (const Frame &sinceFrame) const |
| The angle of rotation around the rotation axis derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame. More... | |
| float | rotationAngle (const Frame &sinceFrame, const Vector &axis) const |
| The angle of rotation around the specified axis derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame. More... | |
| Vector | rotationAxis (const Frame &sinceFrame) const |
| The axis of rotation derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame. More... | |
| Matrix | rotationMatrix (const Frame &sinceFrame) const |
| The transform matrix expressing the rotation derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame. More... | |
| float | rotationProbability (const Frame &sinceFrame) const |
| The estimated probability that the hand motion between the current frame and the specified frame is intended to be a rotating motion. More... | |
| float | scaleFactor (const Frame &sinceFrame) const |
| The scale factor derived from this hand's motion between the current frame and the specified frame. More... | |
| float | scaleProbability (const Frame &sinceFrame) const |
| The estimated probability that the hand motion between the current frame and the specified frame is intended to be a scaling motion. More... | |
| Vector | sphereCenter () const |
| The center of a sphere fit to the curvature of this hand. More... | |
| float | sphereRadius () const |
| The radius of a sphere fit to the curvature of this hand. More... | |
| Vector | stabilizedPalmPosition () const |
| The stabilized palm position of this Hand. More... | |
| float | timeVisible () const |
| The duration of time this Hand has been visible to the Leap Motion Controller. More... | |
| std::string | toString () const |
| A string containing a brief, human readable description of the Hand object. More... | |
| Vector | translation (const Frame &sinceFrame) const |
| The change of position of this hand between the current frame and the specified frame. More... | |
| float | translationProbability (const Frame &sinceFrame) const |
| The estimated probability that the hand motion between the current frame and the specified frame is intended to be a translating motion. More... | |
| Vector | wristPosition () const |
| The position of the wrist of this hand. More... | |
Static Public Member Functions | |
| static const Hand & | invalid () |
| Returns an invalid Hand object. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &, const Hand &) |
| Writes a brief, human readable description of the Hand object to an output stream. More... | |
The Hand class reports the physical characteristics of a detected hand.
Hand tracking data includes a palm position and velocity; vectors for the palm normal and direction to the fingers; properties of a sphere fit to the hand; and lists of the attached fingers.
Get Hand objects from a Frame object:
Note that Hand objects can be invalid, which means that they do not contain valid tracking data and do not correspond to a physical entity. Invalid Hand objects can be the result of asking for a Hand object using an ID from an earlier frame when no Hand objects with that ID exist in the current frame. A Hand object created from the Hand constructor is also invalid. Test for validity with the Hand::isValid() function.
| Hand | ( | HandImplementation * | ) |
| Hand | ( | ) |
| Arm arm | ( | ) | const |
| Matrix basis | ( | ) | const |
The orientation of the hand as a basis matrix.
The basis is defined as follows:
xAxis Positive in the direction of the pinky
yAxis Positive above the hand
zAxis Positive in the direction of the wrist
Note: Since the left hand is a mirror of the right hand, the basis matrix will be left-handed for left hands.
| float confidence | ( | ) | const |
How confident we are with a given hand pose.
The confidence level ranges between 0.0 and 1.0 inclusive.
| Vector direction | ( | ) | const |
The direction from the palm position toward the fingers.
The direction is expressed as a unit vector pointing in the same direction as the directed line from the palm position to the fingers.
You can use the palm direction vector to compute the pitch and yaw angles of the palm with respect to the horizontal plane:
| Finger finger | ( | int32_t | id | ) | const |
The Finger object with the specified ID attached to this hand.
Use the Hand::finger() function to retrieve a Finger object attached to this hand using an ID value obtained from a previous frame. This function always returns a Finger object, but if no finger with the specified ID is present, an invalid Finger object is returned.
Note that ID values persist across frames, but only until tracking of a particular object is lost. If tracking of a finger is lost and subsequently regained, the new Finger object representing that finger may have a different ID than that representing the finger in an earlier frame.
| id | The ID value of a Finger object from a previous frame. |
| FingerList fingers | ( | ) | const |
The list of Finger objects detected in this frame that are attached to this hand, given in order from thumb to pinky.
The list cannot be empty.
Use PointableList::extended() to remove non-extended fingers from the list.
| Frame frame | ( | ) | const |
| float grabAngle | ( | ) | const |
The angle between the fingers and the hand of a grab hand pose.
The angle is computed by looking at the angle between the direction of the 4 fingers and the direction of the hand. Thumb is not considered when computing the angle. The angle is 0 radian for an open hand, and reaches pi radians when the pose is a tight fist.
| float grabStrength | ( | ) | const |
| int32_t id | ( | ) | const |
A unique ID assigned to this Hand object, whose value remains the same across consecutive frames while the tracked hand remains visible.
If tracking is lost (for example, when a hand is occluded by another hand or when it is withdrawn from or reaches the edge of the Leap Motion Controller field of view), the Leap Motion software may assign a new ID when it detects the hand in a future frame.
Use the ID value with the Frame::hand() function to find this Hand object in future frames:
|
static |
Returns an invalid Hand object.
You can use the instance returned by this function in comparisons testing whether a given Hand instance is valid or invalid. (You can also use the Hand::isValid() function.)
| bool isLeft | ( | ) | const |
| bool isRight | ( | ) | const |
| bool isValid | ( | ) | const |
| bool operator!= | ( | const Hand & | ) | const |
| bool operator== | ( | const Hand & | ) | const |
| Vector palmNormal | ( | ) | const |
The normal vector to the palm.
If your hand is flat, this vector will point downward, or "out" of the front surface of your palm.
The direction is expressed as a unit vector pointing in the same direction as the palm normal (that is, a vector orthogonal to the palm).
You can use the palm normal vector to compute the roll angle of the palm with respect to the horizontal plane:
| Vector palmPosition | ( | ) | const |
The center position of the palm in millimeters from the Leap Motion Controller origin.
| Vector palmVelocity | ( | ) | const |
The rate of change of the palm position in millimeters/second.
| float palmWidth | ( | ) | const |
The estimated width of the palm when the hand is in a flat position.
| float pinchDistance | ( | ) | const |
The distance between the thumb and index finger of a pinch hand pose.
The distance is computed by looking at the shortest distance between the last 2 phalanges of the thumb and those of the index finger. This pinch measurement only takes thumb and index finger into account.
| float pinchStrength | ( | ) | const |
| Pointable pointable | ( | int32_t | id | ) | const |
The Pointable object with the specified ID associated with this hand.
Use the Hand::pointable() function to retrieve a Pointable object associated with this hand using an ID value obtained from a previous frame. This function always returns a Pointable object, but if no finger with the specified ID is present, an invalid Pointable object is returned.
Note that the ID values assigned to fingers are based on the hand ID. Hand IDs persist across frames, but only until tracking of that hand is lost. If tracking of the hand is lost and subsequently regained, the new Hand object and its child Finger objects will have a different ID than in an earlier frame.
| id | The ID value of a Pointable object from a previous frame. |
| PointableList pointables | ( | ) | const |
The list of Pointable objects detected in this frame that are associated with this hand, given in arbitrary order.
The list will always contain 5 fingers.
Use PointableList::extended() to remove non-extended fingers from the list.
| float rotationAngle | ( | const Frame & | sinceFrame | ) | const |
The angle of rotation around the rotation axis derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
The angle of rotation around the specified axis derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
| axis | The axis to measure rotation around. |
The axis of rotation derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
The transform matrix expressing the rotation derived from the change in orientation of this hand, and any associated fingers, between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative rotation. |
| float rotationProbability | ( | const Frame & | sinceFrame | ) | const |
The estimated probability that the hand motion between the current frame and the specified frame is intended to be a rotating motion.
| sinceFrame | The starting frame for computing the relative rotation. |
| float scaleFactor | ( | const Frame & | sinceFrame | ) | const |
The scale factor derived from this hand's motion between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the relative scaling. |
| float scaleProbability | ( | const Frame & | sinceFrame | ) | const |
The estimated probability that the hand motion between the current frame and the specified frame is intended to be a scaling motion.
| sinceFrame | The starting frame for computing the relative scaling. |
| Vector sphereCenter | ( | ) | const |
The center of a sphere fit to the curvature of this hand.
This sphere is placed roughly as if the hand were holding a ball.
| float sphereRadius | ( | ) | const |
The radius of a sphere fit to the curvature of this hand.
This sphere is placed roughly as if the hand were holding a ball. Thus the size of the sphere decreases as the fingers are curled into a fist.
| Vector stabilizedPalmPosition | ( | ) | const |
The stabilized palm position of this Hand.
Smoothing and stabilization is performed in order to make this value more suitable for interaction with 2D content. The stabilized position lags behind the palm position by a variable amount, depending primarily on the speed of movement.
| float timeVisible | ( | ) | const |
The duration of time this Hand has been visible to the Leap Motion Controller.
|
inline |
The change of position of this hand between the current frame and the specified frame.
| sinceFrame | The starting frame for computing the translation. |
| float translationProbability | ( | const Frame & | sinceFrame | ) | const |
The estimated probability that the hand motion between the current frame and the specified frame is intended to be a translating motion.
| sinceFrame | The starting frame for computing the translation. |
| Vector wristPosition | ( | ) | const |
The position of the wrist of this hand.
C++