Kinect2 插件
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.Kinect 2.0 是一种运动感应输入设备,可跟踪人体运动并将此数据转换为 3D 世界。传感器检测关节,从而构建虚拟 3D 骨架。
The Kinect2 plugin is used for receiving already detected data from a Kinect2 sensor. The plugin is provided as an add-on.Kinect2 插件用于从 Kinect2 传感器接收已检测到的数据。该插件作为附加组件提供。
Minimum capabilities:最低能力:
- 64-bit (x64) processor64 位 (x64) 处理器
- Physical dual-core 3.1 GHz (2 logical cores per physical) or faster processor物理双核 3.1 GHz(每个物理 2 个逻辑内核)或更快的处理器
- 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 sensorUSB 3.0 控制器专用于 Kinect for Windows v2 传感器或 Kinect Adapter for Windows 与 Kinect for Xbox One 传感器一起使用
- 4 GB of RAM4 GB 内存
- Graphics card that supports DirectX 11支持DirectX 11的显卡
- Windows 8 or 8.1, or Windows Embedded 8Windows 8 或 8.1,或 Windows Embedded 8
- Kinect SDK 2.0
See Also也可以看看#
- Kinect Class (engine.kinect) functionsengine.kinect 函数
-
Samples on the plugin usage:插件使用示例:
- <UnigineSDK>/data/samples/plugins/kinect_00 that shows all 3 buffers (color, depth, IR range)<UnigineSDK>/data/samples/plugins/kinect_00 显示所有 3 个缓冲区(颜色、深度、IR 范围)
- <UnigineSDK>/data/samples/plugins/kinect_01 that shows all detected virtual skeletons<UnigineSDK>/data/samples/plugins/kinect_01 显示所有检测到的虚拟骨架
- <UnigineSDK>/data/samples/plugins/kinect_02 that shows all detected faces<UnigineSDK>/data/samples/plugins/kinect_02 显示所有检测到的人脸
Launching Kinect2 Plugin启动 Kinect2 插件#
To use the plugin, you should perform the following:要使用该插件,您应该执行以下操作:
-
Specify the extern_plugin command line option on the application start-up:在应用程序启动时指定 extern_plugin 命令行选项:
main_x64 -extern_plugin "Kinect"
Implementing Application Using Kinect2 Plugin使用 Kinect2 插件实现应用程序#
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.虚拟骨骼(最多可检测 6 骨骼):骨骼在 3D 世界中的位置和方向、手的位置、每个骨骼检测的准确性。
- 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).人脸(最多可检测6人脸):人脸界限和面部钥匙积分(眼睛、嘴巴、鼻子)在颜色和 IR 缓冲区、特征(眼镜、微笑、闭眼)的坐标中。
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
#ifdef HAS_KINECT
int init () {
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() {
kinect::shutdown();
return;
}
#else
int init() {
Log::warning("No kinect plugin detected");
return 1;
}
int shutdown() {
return 1;
}
#endif
#ifdef HAS_KINECT
int Init () {
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() {
Kinect.Shutdown();
}
#else
int Init() {
Log.Warning("No kinect plugin detected");
return 1;
}
void Shutdown() {
Kinect.Shutdown();
}
#endif
#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