This is a Leap motion guided article in the C + + language, the original address: HTTPS://DEVELOPER.LEAPMOTION.COM/DOCUMENTATION/LANGUAGES/C++/GUIDES/LEAP_ Overview.html, as before, I use the brackets to mark my thoughts and speculations [I am the translator's word]. Because of my English level where any, translate this article to exercise English, the ability of people should read the full text of English. The article by Guoming.me's Xiao Ming carries on the maintenance work, welcome to correct the translation question.
Leap Motion Overview
The Leap motion system detects and tracks hand, finger, and finger-like tools. This device can operate at high accuracy and high tracking frame rates.
Leap motion software analyzes objects within the visual range of the device. It recognizes hands, fingers, and tools to get their positions, gestures and movements in real time. The visible range of Leap motion is an inverted pyramid with a spire in the center of the device. [This is a good understanding, the sensor is generally the case] Leap Motion has a working range of approximately 25 to 600 millimeters in front of the device, which is 1 inches to 2 feet. [2.5 cm to 0.6 m, sure enough to make up for the Kinect short-distance, very suitable for sitting in front of the computer operation]
coordinate system
The system of Leap motion uses the right-hand cartesian coordinates. The returned values are in real-world millimeters [the same as the Kinect's depth data]. The origin point is at the center of the Leap Motion controller. The X-and z-axes are on the horizontal plane of the device, and the x-axis is parallel to the long side of the device [z-axis and short-side parallel, which is good to remember]. The y-axis is vertical and increases in positive values (as opposed to the coordinate system of the computer graphics under direction). The farther from the computer screen, the z-axis value is increasing. [See that little green light, make sure it's aligned to our coordinate system and be careful when placed.] ]
Image above: Right-hand coordinate system motion tracking data for LEAP motion
Because the leap motion device ultimately has hands, fingers, and tools in its field of view, it provides a set of data set updates, either frames, or data. Each frame of data contains a list of basic tracking data, such as hands, fingers, and tools, as well as identifying gestures and describing the motion factors in the scene.
But when you detect your hands, fingers, and tools or gestures, Leap Motion ' software assigns it a unique ID designator. This ID indicator remains the same as long as the entity is in the visible range of the device [and the Kinect's Bone Tracking ID is consistent]. If the tracking target is lost or recovered, the Leap motion software assigns a new ID (the software does not know the hand, the finger is the same as it was seen before) [that is, it does not contain finger recognition, and the Kinect's skeletal tracking is completely consistent after the loss]. Frame
A Frame object provides a list of tracking data, gestures, and overall motion factors within the visual range of leap motion. Tracking Data List
Hands Hand---all hands.
The pointables has the---finger of the end point and the tool with a segment.
Fingers---all the fingers.
Tools----all the tools.
Gestures---the start, end, or update of all gestures.
These three lists with endpoints (Pointables,fingers,tools) contain any objects that have endpoints detected at the data frame. You can get information about objects in your hands by accessing the list of hands. It is important to note that if the user's hand is only part of the vision of leap motion, the finger or tool cannot be associated with the hand. [also say, pay attention to the placement of the hand, to ensure that the hand and tool colleagues are visible within the range]
If you are tracking a single object, such as a finger, by frame after frame, you can use the ID associated with the object to query it in a new frame. With the ID, you can query your hands, fingers, tools, end objects, and gestures. If the object exists at the current frame, then the query function returns a reference to the object. If the object does not exist, then a special invalid object is returned. Invalid objects are well defined, but do not contain any valid tracking data. This technique allows us to simplify a lot of detection of NULL pointers when using leap motion to track data. Frame Motion
Leap Motion Software analyzes the overall motion as long as the previous frame data has shifted, rotated, scaled, and so on. For example, if you move your hands to the left view of leap motion at the same time, the frame contains displacement changes. If you twist your hands, as if rotating a ball, the frame contains rotation. If you move your hands near or away, the frame contains the zoom information. Leap motion software uses objects within the field of view, as long as the analysis has occurred. If it detects only one hand, the Leap motion program gives the frame motion based on the movement of that hand. If it detects a pair of hands, it combines the movement of the two hands and gives the movement factor. You can also get individual motion parameters through the corresponding hand object of each hand.
Frame motion information is generated by comparing the current frame with a previous special frame. Properties that describe the composition motion include:
1. Rotation coordinates rotation Axis----a direction vector to describe the rotation of coordinates.
2. Rotation angle rotation Angle----rotation angle in the clockwise direction relative to the rotational coordinates (Cartesian coordinate system).
3. The rotation matrix rotation matrix-----A rotation transformation.
4. Scaling factor scale Factor------a factor to describe expansion and contraction.
5. Displacement translation-----------a vector to describe linear motion.
You can manipulate objects in your application using motion factors without having to track individual hands and fingers in multi-frame data. [i.e. factors can be modified manually]
The frame structure contains an estimate of a particular movement in a direction. For example, if you have a large zoom factor, you can ignore rotation, or displacement in the frame (if this makes your app more realistic). Filtering out unwanted motion information through a probabilistic approach makes your program easier to use. [In other words, focus only on the most important movement, ignoring those minor changes, after all, people are not machines, for example, to do rotation can be determined to occur a certain displacement] Hand Model
The hand model provides the coordinates, characteristics, and movement of the hand, or other detected fingers, tools.
The interface functions of Leap motion provide as much information about a hand as possible. At that time, the Leap motion program might not be able to calculate the hand information at each frame. For example, when a hand is clenched into a fist, its fingers cannot be seen by leap Motion, so the message of the finger is empty. Your app should be able to handle the disappearing state of these models.
The Leap Motion program also does not determine whether a hand is left or right [Kinect judging ~]. In the list of hands, there can be more than 2 hand information, because more than one person can also appear a hand-like object in the field of leap motion. However, we recommend that you allow up to two hands to appear in the vision of the Leap motion controller at the same time, which ensures optimal tracking quality. Hand Properties
The Hand object provides some properties to reflect the physical characteristics of the one being detected.
1. Palm Position-------------in the coordinate system of leap motion, the coordinates of the Palm Center are measured in millimeters.
2. Palm Velocity palms speed-------------palms mm/s movement per second.
3. Palm Standard palm normal--------------with the palm of the plane formed by the vertical vector, vector direction pointing to the inside of the palm.
4. Direction direction-------------------A vector of fingers pointing from the center of the palm.
5. The Center of the sphere sphere------------can be suitable for the inner surface of the palm of a sphere. (Suppose holding a ball)
6. Ball radius Sphere radius------------above, this is the ball radius. When the shape of the hand changes, the radius changes accordingly.
The direction and Palm standard is a vector describing the direction of the hand in the Leap motion coordinate system.
Above: Palm standard perpendicular to palm outward, direction toward finger direction.
Image above: When the hand is curled, the ball becomes smaller
The sphere and radius describe a ball, which satisfies the curvature of the palm, which can be held by the palm.
Hand Movement
The Hand object also provides some properties for describing the hand motion. The Leap Motion program analyzes the movement of the hand, including the fingers associated with the hand, the displacement, rotation, and scaling of the tool. Moving your hand around the motion of leap Motion produces a displacement. Open, twist and tilt your hand to produce rotation. By moving your gestures or tools toward or away from leap motion, you can generate zooming.
The movement of the hand is obtained by comparing the current frame to a specific frame. The properties that describe hand motion are the same as frame motion.
1. Rotation coordinates rotation Axis
2. Rotation angle Rotation Angle
3. Rotation matrix rotation matrix
4. Scaling Factor scale Factor
5. Displacement translation
The Hand object also contains the most important estimates for hand motion. [The back is the same, don't say anymore] list of fingers and tools
You can access the fingers and tools associated with your hand through one of the three below:
1. Endpoint pointables------fingers and tools are end objects.
2. Finger fingers----------only fingers.
3. Tool tools-------------just tools.
You can also access individual fingers and tools by using the ID obtained in the previous frame. Using Hand::finger (), Hand::tool (), or you do not need to differentiate between fingers and tools, use hand::p the ointable () function. These functions return a reference to an object in the current frame. If the finger and the tool are not associated with the hand in this frame, then an invalid object is returned. finger and tool models
The Leap motion device not only detects and tracks the finger tracking tool in the field of view. The Leap motion program classifies finger-like objects by shape. Whether a tool is longer, thinner, or straighter than a finger.
In the leap motion model, the physical characteristics of the fingers and tools are abstracted into an endpoint object. Fingers and tools are a class of endpoint objects, and the physical characteristics of the endpoint objects include:
1 length-------The visible length of the object (the part from hand length).
2 width-------The average width of the object. [Attention Average OH]
3. Direction direction---a unit toward the vector, the direction is the same as the object point. (e.g. from base to tip)
4. Tip coordinates tip Position----The position of the pointer in the Leap motion coordinate system.
5. CUSP rate tip velocity-----Tip motion mm/sec.
Above: red dot or pointed coordinate, pointer-type tip direction.
The Leap Motion program identifies the detected endpoint object as either a finger or a tool. Use the Pointable::istool () function to determine which type of endpoint object is.
This tool is longer, thinner and straighter than a finger. gestures
The Leap Motion program recognizes specific motion patterns as gestures and can guess the user's intentions or instructions. Leap motion is consistent with gesture access methods in one frame of data and other fingers and gestures. For each gesture that is detected, Leap motion adds a gesture object gesture object to the frame data. You can use the frame gesture list to get the gesture object.
The following are the motion modes that leap motion can recognize. [The emphasis comes, ah, can not understand below will have the image signal ~]
1 Circle Circle----a finger to draw a circle.
2. Wave the linear motion of the swipe----hand.
3. Press key tap key tap to move-----finger, just like pressing the keyboard.
4. Tap screen tap----to vertical click on the screen orientation of your computer.
But leap motion makes it difficult for a motion recognition to cross a gesture pattern, which adds the gesture object to the frame. If the gesture repeats several times, Leap motion adds the updated gesture object to the subsequent frame. The circular and waving gestures are continuous. Leap Motion continuously updates these gestures for each frame of the program. A discrete gesture when clicked. Leap Motion reports Each Click as a stand-alone gesture object.
Important: Before you use gestures in your app, you must turn on each of the gestures you need to recognize. The control class has a enablegesture () method that lets you turn on specific gesture recognition. [That is, the beginning is closed, not open can not be used] Circle
Leap Motion recognizes that the fingers are moving round in the air, returning a circle gesture circle gesture.
Above: The circle gesture of the index finger
You can circle with any finger and tool. The circle gesture is continuous. Once this gesture is started, Leap motion continues to update the state until it stops. But the finger or tool is far away from the track or movement is too slow, and the circle gesture terminates.
You can see more information from the Circlegesture interface function Reference. Wave
Leap Motion recognizes the linear motion of a finger as a waving gesture.
Above: a gesture of horizontal waving.
You can hand gestures in any direction with any finger. The waving gesture is continuous. Once the gesture starts, the Leap motion opportunity updates the status until the gesture ends. The waving gesture ends when the finger changes direction or moves too slowly.
For more information, refer to the Swipegesture interface function documentation. Click
Leap motion can recognize 2 clicks, click on Key tap and click on the screen tap on the forward screens. Click on the button
Leap Motion recognizes the movement of a fast, downward finger or tool as a key Tap.
Image above: Key gesture of index finger
You can create a button click gesture as you would press the piano key. When you press the key, the tap gesture is discrete. Only one stand-alone gesture object will be added to the click Gesture.
More information can be seen from the Keytapgesture interface function. Screen Click
Leap motion can make a quick, forward-facing click on a finger or tool to recognize a screen click gesture.
Above: The screen click gesture of the index finger
You can click Forward or push your hand forward to create a screen click, just like touching a screen perpendicular to you. Click gestures are discrete, and only a single gesture object will be added to the click Gesture.
You can see more information in the Screentapgesture interface function.