This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
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
Учебные материалы

Плагин 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 - это устройство ввода с датчиком движения, которое отслеживает движения человеческого тела и преобразует эти данные в трехмерные миры. Датчик обнаруживает суставы, создавая виртуальный трехмерный каркас.

The Kinect2 plugin is used for receiving already detected data from a Kinect2 sensor. The plugin is provided as an add-on.Плагин Kinect2 используется для получения уже собранных данных от датчика Kinect2. Плагин предоставляется в виде дополнения (add-on).

kinect_00 Sample that shows Kinect buffers: color, depth, and IR rangekinect_00 Пример, показывающий буферы Kinect: цвет, глубина и ИК-диапазон

Minimum capabilities:Минимальные системные требования:

  • 64-bit (x64) processor64-битный (x64) процессор
  • Physical dual-core 3.1 GHz (2 logical cores per physical) or faster processorПроцессор с 2мя физическими ядрами с тактовой частотой 3,1 ГГц (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 sensorКонтроллер USB 3.0, предназначенный для датчика Kinect для Windows v2 или адаптера Kinect для Windows для использования с датчиком Kinect для Xbox One
  • 4 GB of RAM4 ГБ оперативной памяти
  • 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) functionsФункции engine.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 буфера (цвет, глубина, ИК-диапазон)
    • <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 при запуске приложения:

    Shell-команды
    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 скелетов): положение и ориентация костей в трехмерном мире, положение рук, точность обнаружения каждой кости.
  • 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 лиц): границы лица и ключевые точки лица (глаза, рот, нос) в координатах цветового и ИК-буфера, дополнительные детали (очки, улыбка, закрытые глаза).
Примечание
When the plugin is loaded, the engine.kinect library with a bunch of functions is added to UnigineScript.Когда плагин загружен, в API добавляется библиотека engine.kinect со множеством функций.

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
Последнее обновление: 12.01.2024
Build: ()