注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
Kinect2 Add-On
A Kinect 2.0 is a motion sensing input device that tracks the human body motions and translates this data to 3D worlds. The sensor detects joints therefore building a virtual 3D skeleton.
A Kinect2 plugin is used for receiving already detected data from a Kinect2 sensor. The plugin is provided as an add-on.
kinect_00 Sample That Shows Kinect Buffers: Color, Depth and IR Range
Minimum capabilities:
- 64-bit (x64) processor
- Physical dual-core 3.1 GHz (2 logical cores per physical) or faster processor
- USB 3.0 controller dedicated to the Kinect for Windows v2 sensor or the Kinect Adapter for Windows for use with the Kinect for Xbox One sensor
- 4 GB of RAM
- Graphics card that supports DirectX 11
- Windows 8 or 8.1, or Windows Embedded 8
See Also
- engine.kinect functions
- Samples on plugin usage:
- data/samples/plugins/kinect_00 that shows all 3 buffers (color, depth, IR range).
- data/samples/plugins/kinect_01 that shows all detected virtual skeletons.
- data/samples/plugins/kinect_02 that shows all detected faces.
The samples will be available if you add the Kinect2 plugin add-on to your project via UNIGINE SDK Browser.
Launching Kinect2 Plugin
To use the plugin, you should perform the following:
- Install the Kinect2 plugin (available via UNIGINE SDK Browser in the Add-Ons section) and add it to your project (by clicking Configure Project -> Add-ons in the Projects section of UNIGINE SDK Browser).
- Specify the extern_plugin command line option on the application start-up:
main_x86 -extern_plugin "Kinect"
Implementing Application Using Kinect2 Plugin
The plugin can receive the following types of data:
- Buffers: color, depth, IR range.
- Virtual skeletons (up to 6 skeletons can be detected): position and orientation of bones in a 3D world, position of hands, accuracy of each bone detection.
- Faces (up to 6 faces can be detected): face boundaries and facial key points (eyes, mouth, nose) in coordinates of color and IR buffers, features (eye glasses, smile, closed eyes).
When the plugin is loaded, the engine.kinect library with a bunch of functions is added to UnigineScript.
When implementing an application using the plugin, it is necessary to call the engine.kinect.init() function with the required arguments on engine initialization and the engine.kinect.shutdown() function on engine shutdown. For example:
#ifdef HAS_KINECT
int init () {
engine.kinect.init(KINECT_STREAM_INFRARED | KINECT_STREAM_DEPTH | KINECT_STREAM_COLOR);
return 1;
}
int update() {
// update logic
// here you can, for example, show the contents of the required buffers
return 1;
}
void shutdown() {
engine.kinect.shutdown();
return 1;
}
#else
int init() {
log.warning("No kinect plugin detected");
return 1;
}
int shutdown() {
return 1;
}
#endif
Last update: 2017-07-03
Help improve this article
(or select a word/phrase and press Ctrl+Enter)