(3) Kinect gesture recognition

Kinect has many built-in poses for us, such as raising hands, etc. For details, please refer to the enumeration KinectGestures.Gestures, or you can import custom poses through the Kinect pose manager (there are many pits, and the built-in ones are basically enough), and you can also customize the poses according to the joint coordinates. Program your own definition of poses. This section mainly explains the use of built-in poses.

This part can refer to the plug-in scenes KinectGesturesDemo1 and KinectGesturesDemo2. To use the built-in poses, you only need to implement the interface ModelGestureListener : MonoBehaviour , KinectGestures.GestureListenerInterface in your own script . Reference scripts ModelGestureListener and CubeGestureListener

Interface method:

1)public void UserDetected(long userId, int userIndex)

This method is used to register the detected gestures, that is, to define the gestures to be detected

2)public void UserLost(long userId, int userIndex)

This method is executed when the user defined by userIndex in UserDetected is lost

3)public void GestureInProgress(long userId, int userIndex, KinectGestures.Gestures gesture,
                                  float progress, KinectInterop.JointType joint, Vector3 screenPos)

How to motivate while the pose is in progress

4)public bool GestureCompleted (long userId, int userIndex, KinectGestures.Gestures gesture,
                                  KinectInterop.JointType joint, Vector3 screenPos)

This method is activated when the pose is complete

5) public bool GestureCancelled (long userId, int userIndex, KinectGestures.Gestures gesture,
                                  KinectInterop.JointType joint)
activate this method when canceled

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325106761&siteId=291194637