|
def | __eq__ (self, arg2) |
|
def | __init__ (self) |
|
def | __ne__ (self, arg2) |
|
def | __str__ (self) |
|
LEAP_EXPORT float | currentFramesPerSecond () const |
|
def | deserialize (self, ptr, length) |
|
def | deserialize (self, tup) |
|
void | deserialize (const std::string &str) |
|
void | deserialize (const unsigned char *ptr, int length) |
|
def | finger (self, id) |
|
LEAP_EXPORT Finger | finger (int32_t id) const |
|
LEAP_EXPORT FingerList | fingers () const |
|
| Frame (FrameImplementation *) |
|
LEAP_EXPORT | Frame () |
|
def | gesture (self, id) |
|
LEAP_EXPORT Gesture | gesture (int32_t id) const |
|
def | gestures (self, args) |
|
LEAP_EXPORT GestureList | gestures () const |
|
LEAP_EXPORT GestureList | gestures (const Frame &sinceFrame) const |
|
def | hand (self, id) |
|
LEAP_EXPORT Hand | hand (int32_t id) const |
|
LEAP_EXPORT HandList | hands () const |
|
LEAP_EXPORT int64_t | id () const |
|
LEAP_EXPORT ImageList | images () const |
|
LEAP_EXPORT InteractionBox | interactionBox () const |
|
LEAP_EXPORT bool | isValid () const |
|
LEAP_EXPORT bool | operator!= (const Frame &) const |
|
LEAP_EXPORT bool | operator== (const Frame &) const |
|
def | pointable (self, id) |
|
LEAP_EXPORT Pointable | pointable (int32_t id) const |
|
LEAP_EXPORT PointableList | pointables () const |
|
def | rotation_angle (self, args) |
|
def | rotation_axis (self, sinceFrame) |
|
def | rotation_matrix (self, sinceFrame) |
|
def | rotation_probability (self, sinceFrame) |
|
LEAP_EXPORT float | rotationAngle (const Frame &sinceFrame) const |
|
LEAP_EXPORT float | rotationAngle (const Frame &sinceFrame, const Vector &axis) const |
|
LEAP_EXPORT Vector | rotationAxis (const Frame &sinceFrame) const |
|
LEAP_EXPORT Matrix | rotationMatrix (const Frame &sinceFrame) const |
|
LEAP_EXPORT float | rotationProbability (const Frame &sinceFrame) const |
|
def | scale_factor (self, sinceFrame) |
|
def | scale_probability (self, sinceFrame) |
|
LEAP_EXPORT float | scaleFactor (const Frame &sinceFrame) const |
|
LEAP_EXPORT float | scaleProbability (const Frame &sinceFrame) const |
|
def | serialize (self, ptr) |
|
def | serialize (self) |
|
std::string | serialize () const |
|
void | serialize (unsigned char *ptr) const |
|
int | serializeLength () const |
|
LEAP_EXPORT int64_t | timestamp () const |
|
def | tool (self, id) |
|
LEAP_EXPORT Tool | tool (int32_t id) const |
|
LEAP_EXPORT ToolList | tools () const |
|
std::string | toString () const |
|
LEAP_EXPORT TrackedQuad | trackedQuad () const |
|
def | translation (self, sinceFrame) |
|
LEAP_EXPORT Vector | translation (const Frame &sinceFrame) const |
|
def | translation_probability (self, sinceFrame) |
|
LEAP_EXPORT float | translationProbability (const Frame &sinceFrame) const |
|
def | __init__ (self, args, kwargs) |
|
The Frame class represents a set of hand and finger tracking data detected in a single frame.
The Leap Motion software detects hands, fingers and tools within the tracking area, reporting their positions, orientations, gestures, and motions in frames at the Leap Motion frame rate.
Access Frame objects through an instance of the Controller class:
Implement a Listener subclass to receive a callback event when a new Frame is available.
- Since
- 1.0
Definition at line 4634 of file Leap.h.
void Leap::Frame::deserialize |
( |
const std::string & |
str | ) |
|
|
inline |
Decodes a byte string to replace the properties of this Frame.
A Controller object must be instantiated for this function to succeed, but it does not need to be connected. To extract gestures from the deserialized frame, you must enable the appropriate gestures first.
Any existing data in the frame is destroyed. If you have references to child objects (hands, fingers, etc.), these are preserved as long as the references remain in scope.
Note: The behavior when calling functions which take another Frame object as a parameter is undefined when either frame has been deserialized. For example, calling gestures(sinceFrame)
on a deserialized frame or with a deserialized frame as parameter (or both) does not necessarily return all gestures that occurred between the two frames. Motion functions, like scaleFactor(startFrame)
, are more likely to return reasonable results, but could return anomalous values in some cases.
- Parameters
-
str | A std:string object containing the serialized bytes of a frame. |
- Since
- 2.1.0
Definition at line 5214 of file Leap.h.
The Finger object with the specified ID in this frame.
Use the Frame::finger() function to retrieve the Finger object from this frame 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 physical finger may have a different ID than that representing the finger in an earlier frame.
- Parameters
-
id | The ID value of a Finger object from a previous frame. |
- Returns
- The Finger object with the matching ID if one exists in this frame; otherwise, an invalid Finger object is returned.
- Since
- 1.0
The Hand object with the specified ID in this frame.
Use the Frame::hand() function to retrieve the Hand object from this frame using an ID value obtained from a previous frame. This function always returns a Hand object, but if no hand with the specified ID is present, an invalid Hand object is returned.
Note that ID values persist across frames, but only until tracking of a particular object is lost. If tracking of a hand is lost and subsequently regained, the new Hand object representing that physical hand may have a different ID than that representing the physical hand in an earlier frame.
- Parameters
-
id | The ID value of a Hand object from a previous frame. |
- Returns
- The Hand object with the matching ID if one exists in this frame; otherwise, an invalid Hand object is returned.
- Since
- 1.0
Reports whether this Frame instance is valid.
A valid Frame is one generated by the Leap::Controller object that contains tracking data for all detected entities. An invalid Frame contains no actual tracking data, but you can call its functions without risk of a null pointer exception. The invalid Frame mechanism makes it more convenient to track individual data across the frame history. For example, you can invoke:
for an arbitrary Frame history value, "n", without first checking whether frame(n) returned a null object. (You should still check that the returned Finger instance is valid.)
- Returns
- True, if this is a valid Frame object; false otherwise.
- Since
- 1.0
The Pointable object with the specified ID in this frame.
Use the Frame::pointable() function to retrieve the Pointable object from this frame using an ID value obtained from a previous frame. This function always returns a Pointable object, but if no finger or tool with the specified ID is present, an invalid Pointable 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 or tool is lost and subsequently regained, the new Pointable object representing that finger or tool may have a different ID than that representing the finger or tool in an earlier frame.
- Parameters
-
id | The ID value of a Pointable object from a previous frame. |
- Returns
- The Pointable object with the matching ID if one exists in this frame; otherwise, an invalid Pointable object is returned.
- Since
- 1.0
The angle of rotation around the rotation axis derived from the overall rotational motion between the current frame and the specified frame.
The returned angle is expressed in radians measured clockwise around the rotation axis (using the right-hand rule) between the start and end frames. The value is always between 0 and pi radians (0 and 180 degrees).
The Leap Motion software derives frame rotation from the relative change in position and orientation of all objects detected in the field of view.
If either this frame or sinceFrame is an invalid Frame object, then the angle of rotation is zero.
- Parameters
-
sinceFrame | The starting frame for computing the relative rotation. |
- Returns
- A positive value containing the heuristically determined rotational change between the current frame and that specified in the sinceFrame parameter.
- Since
- 1.0
The angle of rotation around the specified axis derived from the overall rotational motion between the current frame and the specified frame.
The returned angle is expressed in radians measured clockwise around the rotation axis (using the right-hand rule) between the start and end frames. The value is always between -pi and pi radians (-180 and 180 degrees).
The Leap Motion software derives frame rotation from the relative change in position and orientation of all objects detected in the field of view.
If either this frame or sinceFrame is an invalid Frame object, then the angle of rotation is zero.
- Parameters
-
sinceFrame | The starting frame for computing the relative rotation. |
axis | The axis to measure rotation around. |
- Returns
- A value containing the heuristically determined rotational change between the current frame and that specified in the sinceFrame parameter around the given axis.
- Since
- 1.0
The axis of rotation derived from the overall rotational motion between the current frame and the specified frame.
The returned direction vector is normalized.
The Leap Motion software derives frame rotation from the relative change in position and orientation of all objects detected in the field of view.
If either this frame or sinceFrame is an invalid Frame object, or if no rotation is detected between the two frames, a zero vector is returned.
- Parameters
-
sinceFrame | The starting frame for computing the relative rotation. |
- Returns
- A normalized direction Vector representing the axis of the heuristically determined rotational change between the current frame and that specified in the sinceFrame parameter.
- Since
- 1.0
The scale factor derived from the overall motion between the current frame and the specified frame.
The scale factor is always positive. A value of 1.0 indicates no scaling took place. Values between 0.0 and 1.0 indicate contraction and values greater than 1.0 indicate expansion.
The Leap Motion software derives scaling from the relative inward or outward motion of all objects detected in the field of view (independent of translation and rotation).
If either this frame or sinceFrame is an invalid Frame object, then this method returns 1.0.
- Parameters
-
sinceFrame | The starting frame for computing the relative scaling. |
- Returns
- A positive value representing the heuristically determined scaling change ratio between the current frame and that specified in the sinceFrame parameter.
- Since
- 1.0
The Tool object with the specified ID in this frame.
Use the Frame::tool() function to retrieve the Tool object from this frame using an ID value obtained from a previous frame. This function always returns a Tool object, but if no tool with the specified ID is present, an invalid Tool object is returned.
Note that ID values persist across frames, but only until tracking of a particular object is lost. If tracking of a tool is lost and subsequently regained, the new Tool object representing that tool may have a different ID than that representing the tool in an earlier frame.
- Parameters
-
id | The ID value of a Tool object from a previous frame. |
- Returns
- The Tool object with the matching ID if one exists in this frame; otherwise, an invalid Tool object is returned.
- Since
- 1.0
The change of position derived from the overall linear motion between the current frame and the specified frame.
The returned translation vector provides the magnitude and direction of the movement in millimeters.
The Leap Motion software derives frame translation from the linear motion of all objects detected in the field of view.
If either this frame or sinceFrame is an invalid Frame object, then this method returns a zero vector.
- Parameters
-
sinceFrame | The starting frame for computing the relative translation. |
- Returns
- A Vector representing the heuristically determined change in position of all objects between the current frame and that specified in the sinceFrame parameter.
- Since
- 1.0