This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

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 传感器接收已检测到的数据。该插件作为附加组件提供。

kinect_00 Sample that shows Kinect buffers: color, depth, and IR rangekinect_00 显示 Kinect 缓冲区的示例:颜色、深度和 IR 范围

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 "UnigineKinect"

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 the plugin is loaded, the engine.kinect library with a bunch of functions is added to UnigineScript.当插件加载时,带有一堆函数的 engine.kinect 库被添加到 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:

源代码 (UnigineScript)
#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
When implementing an application using the plugin, it is necessary to call the init() function with the required arguments on engine initialization and the shutdown() function on engine shutdown. For example:
源代码 (C++)
#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
When implementing an application using the plugin, it is necessary to call the Init() function with the required arguments on engine initialization and the Shutdown() function on engine shutdown. For example:
源代码 (C#)
#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
使用插件实现应用程序时,需要在引擎初始化时使用所需的参数调用 engine.kinect.init() 函数,在引擎关闭时调用 engine.kinect.shutdown() 函数。例如:

源代码 (UnigineScript)
#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
最新更新: 2024-01-12
Build: ()