How to adjust Kinect sensor automatically based on user positions ?

By | August 17, 2013

This is an interesting question. Can we really adjust sensor based on user positions ?  The answer will be YES, We can. But limitation is only either in horizontal or vertical direction.   Kinect device has a tiny motor which is used to change the camera and sensor’s angles, to get the correct position of the human  skeleton. The motor can be tilted vertically up to 27 degrees, which means that the Kinect sensor’s angles can be shifted upwards or downwards by 27 degrees.

The Skeleton class has a property named ClippedEdges, which is of type FrameEdges, which says which portion/ parts of the skeleton are out of the Kinect’s view. FrameEdges is a Flag enumeration with the following flags:
• None
• Right
• Left
• Top
• Bottom

None means, Kinect can view the complete skeleton and there is no  area which is cutting out from Kinect view area. For other values, they indicates which part of the body / join is cutting out.  Based on this value you can provide live feedback to users on standing properly and for top and bottom, you can change the sensor elevation angle ( by setting the ElevationAngle property) .

For example, ClippedEdgesUpdates() method from the SkeletonFrameReady event handler, where you can pass the individual skeleton frame to check if any body area is getting cut off.

private void ClippedEdgesUpdates(Skeleton skeleton)
{
switch (skeleton.ClippedEdges)
{
case FrameEdges.Bottom:
SkeletonCutArea(FrameEdges.Bottom); // Change the sensor elevation angle
break;
case FrameEdges.Left:
SkeletonCutArea(FrameEdges.Left);
break;
case FrameEdges.None:
SkeletonCutArea(FrameEdges.None);
break;
case FrameEdges.Right:
SkeletonCutArea(FrameEdges.Right);
break;
case FrameEdges.Top:
SkeletonCutArea(FrameEdges.Top);  // Change sensor elevation angle.
break;
default:
break;
}
}

The ClippedEdgesUpdates() method accepts the tracked skeleton and checks the ClippedEdges property if any of the FrameEdges flags have been set. Depending on the flag values, call the SkeletonCutArea() method, where you can write your own implementation to notify the user for what action to be taken.  For Bottom and Top, you can set the sensor elevation angle  to adjust the sensor

One thought on “How to adjust Kinect sensor automatically based on user positions ?

  1. Pingback: .NET Tips and Tricks from Daily .NET Tips – July and August 2013 Links | Abhijit's World of .NET

Comments are closed.