骨架跟踪有4个kinects [英] Skeleton Tracking with 4 kinects

查看:69
本文介绍了骨架跟踪有4个kinects的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在研究一个需要360°自由追踪人体的项目,所以我决定使用4个运动。

i'm working on a project that needs to track a human body with a 360° freedom, so i decided to use 4 kinects.

最初我开始使用带有开关系统的4个kinect的Beta2 SDK(带有4个不同USB控制器的PC),所以我曾经杀死正在跟踪的kinect实例,然后创建另一个用于kinect我需要执行骨架跟踪。 

Initially i started with the Beta2 SDK using 4 kinects with a switch system (with a PC with 4 different USB controllers) , so i used to kill the kinect instance which is tracking and then create another one for the kinect i need to perform the skeleton tracking. 

现在我正在使用SDK 1.0,似乎实例无法被杀死。

Now i'm using the SDK 1.0, and seems that the instance cannot be killed.

更具体地说,在我的应用程序的init上,我使用NuiCreateSensorById创建了第一个kinect的实例,传递了第一次启动时真正需要的kinect的ID。然后使用NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON)。

More specifically, on the init of my application i create the instance of the first kinect using NuiCreateSensorById passing the ID of the kinect i really need for the first boot. Then use NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON).

之后它会正常开始跟踪并正确地完成我的工作。

After that it start tracking normally and do my stuffs correctly.

当我需要切换到另一个kinect时,我按照以下步骤操作:

When i need to switch to another kinect, i follow these steps :

//INuiSensor* _kinect;  defined in my *.h file

_kinect->NuiSkeletonTrackingDisable();
     	//(on the current kinect) 

_kinect->Release();					   
        //(on the current kinect)

HRESULT hr = _kinect->NuiCreateSensorById(L"ID_",_kinect);
        //(with the ID of the new kinect i need)

//at this point i get S_OK from his HRESULT

_kinect->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON);	        //(on the new kinect)

_kinect->NuiSkeletonTrackingEnable(_hanler,0);

问题是 

_kinect->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON);

在新的kinect上它开始循环并且永不返回,但我无法理解为什么!

on the new kinect it starts a loop and never return, but i can't understand why!

以前使用旧的Beta2,我的kinect开关的这些步骤运行良好! (我升级到1.0,因为在Beta2中,DLL永远不会终止)。

Previously with the old Beta2 these steps for my kinect switch works well! ( i upgraded to 1.0 because in Beta2, the DLL never terminate).

有人可以帮我吗? 

Can someone help me please? 

非常感谢,

regads

FOX_ITA

 

 

推荐答案

进行多次通话时,V1.0 SDK中存在已知问题到NuiInitialize。发行说明提供了一种解决方法:

There is a known problem in the V1.0 SDK when making multiple calls to NuiInitialize. The release notes provide a workaround:

如果C ++代码正在执行NuiInitialize / NuiShutdown在应用程序的生命周期中多次调用SetDeviceStatusCallback,在调用这些调用之前应调用一次。

此外,我还建议在发布第一个传感器之前调用NuiShutdown,以确保它释放对骨架跟踪器的锁定。否则,您在另一个传感器上对NuiInitialize的后续调用可能会因E_NUI_SKELETAL_ENGINE_BUSY而失败。

Also, I'd also recommend calling NuiShutdown before releasing your first sensor, to ensure that it releases its lock on the skeleton tracker. Otherwise, your subsequent call to NuiInitialize on another sensor may fail with E_NUI_SKELETAL_ENGINE_BUSY.

John zh
K4W Dev

John
K4W Dev


这篇关于骨架跟踪有4个kinects的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆