Skeletal Viewer C++ Sample
Kinect for Windows 1.5, 1.6
When you run this sample, you see the following:
- The Depth View, showing background in grayscale and different people in different colors. Darker colors mean more distance from the sensor. People are detected only if their entire body fits within the captured frame.
- The Skeletal View, showing tracked skeletons only if the entire body of at least one person fits within the captured frame.
- The Color View, showing the video being captured.
- The frame rate of the data capture.
|The Sample Uses the Following APIs||To Do This|
|NuiGetSensorCount||Get the number of sensors that are plugged in and ready for use.|
|NuiCreateSensorByIndex Function and INuiSensor Interface||Create an interface that represents a connected sensor.|
|INuiSensor::NuiStatus Method||Check the sensor status to see if the sensor is connected.|
|INuiSensor::NuiInitialize Method and NUI_INITIALIZE_FLAG_USES_COLOR constant||Initialize the sensor to stream out color data.|
|INuiSensor::NuiSkeletonTrackingEnable Method||Open a skeleton stream to receive skeleton data.|
|NUI_SKELETON_FRAME Structure and INuiSensor::NuiSkeletonGetNextFrame Method||Get a frame of skeleton data.|
|INuiSensor::NuiTransformSmooth Method||Smooth out the skeleton data.|
|NUI_SKELETON_TRACKING_STATE enumeration||Make sure that all joints in the skeleton are being tracked.|
|NuiTransformSkeletonToDepthImage(Vector4, LONG*, LONG*, USHORT*, NUI_IMAGE_RESOLUTION)||Return coordinates in NUI_IMAGE_RESOUTION_320x240 space.|
|NUI_SKELETON_POSITION_TRACKING_STATE enumeration||Make sure each joint is being tracked before displaying it.|
|NuiShutdown||Turn the sensor off.|
To run a sample you must have the Kinect for Windows SDK installed. To compile a sample, you must have the developer toolkit installed. The latest SDK and developer toolkit are available on the developer download page. If you need help installing the toolkit, look on this page: To Install the SDK and Toolkit. The toolkit includes a sample browser, which you can use to launch a sample or download it to your machine. To open the sample browser, click Start > All Programs > Kinect for Windows SDK [version number] > Developer Toolkit Browser.
If you need help loading a sample in Visual Studio or using Visual Studio to compile, run, or debug, see Opening, Building, and Running Samples in Visual Studio.