The building blocks – Joints and JointCollection

Joints and JointCollection are the building blocks of Skeleton. Each Skeleton object has a property named Joints, which is a type of JointCollection and contains all the traceable joints. JointCollecton contains a set of Joints and can be accessed by specifying the index value. When you pass JointType to get the Joint point, it will return the Joint object.

Let's consider you have an object of a tracked skeleton as follows:

Skeleton skeleton = (from trackskeleton in totalSkeleton
where trackskeleton.TrackingState == SkeletonTrackingState.Tracked
select trackskeleton).FirstOrDefault();

In the previous code, the skeleton object now contains Joints in the form of JointCollection. Now to get the reference of a particular joint type, you need to pass the type within the collection as shown in the following example for the Head JointType:

Joint headJoint= skeleton.Joints[JointType.Head]);

headJoint now refers to HeadJoint of the skeleton object, with tracking state and position.

In general we can represent the joints with any shape because they are totally based on the coordinate system, and we can understand where the position is. We must be clear about the basic definitions of the skeleton joint coordinate systems. All the joints are represented as three dimensions (x, y, z) and the right-handed coordinate system is used by convention, meaning that the z axis is the positive cross product of the x and y axes, with x pointing to the right, y pointing up, and z pointing at the viewer.

The building blocks – Joints and JointCollection

Each individual position represents using a well-defined structure Joint within the SDK. The structure of every joint is represented using three main properties:

  • JointType
  • Positions
  • TrackingState

The JointType property is a value in the JointType enumeration, which has the names of all 20 joints. Each and every joint position represents an object of SkeletonPoint. The Position property is a type of SkeletonPoint, which represents the x, y, and z values of Joint.

It may happen that all the joints are not visible to the sensor due to some obstacle or human position. Once the sensor has tracked the skeleton and a couple of joints thatare clearly visible to the sensor, it will try to infer the location for the rest of the joints. If it fails to infer, then they will be marked as NotTracked. The JointTrackingState property describes if the joint is being tracked, inferred, o not tracked.

Joint-tracking state

All the skeleton joints are associated with the property JointTrackingState, which returns the tracking state for the current joint. JointTrackingState is an enumeration defined in the SDK library.

JointTrackingState Enumeration

Name

Description

Tracked

When the tracking state is Tracked, the sensor has a clear vision of the joint position and all the three coordinates (x, y, z) are captured properly.

NotTracked

Joint tracking state returns NotTracked when the joints are not visible to the sensor and the sensor is not able to track.

Inferred

When the tracking status is Inferred, the Kinect sensor does not have the actual joint position data, but it has made some calculations for the joint points based on other tracked joints.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.247.31