如何同时初始化两个Kinect? (SkeletalViewer) [英] How to initialize two Kinect simultaneously? (SkeletalViewer)

查看:206
本文介绍了如何同时初始化两个Kinect? (SkeletalViewer)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从SkeletalViewer中的两个kinect相机同时做骨架跟踪,并获得骨架结果。在我的理解,Nui_Init()只处理第一个Kinect的线程(我认为index = 0)。然而,我可以有两个骨架跟踪运行在同一时间,我想分别输出到两个文本文件在同一时间。



(例如Kinect 0输出到cam0.txt,而Kinect 1输出到cam1.txt)

有没有人在这种情况下有经验或能提供帮助?



尊敬,



Eva



PS:我从Kinect SDK文档中读到这一点:


如果您使用多个Kinect传感器,骨架跟踪仅在您初始化的第一个设备上工作。要切换用于跟踪的设备,请取消初始化旧设备并初始化新设备。


同时获取坐标?或者即使逐一收购,我应该如何分开叫他们? (因为我意识到活动Kinect的索引将为0,我不能区分它们)。

解决方案

您正在使用MS SkeletalViewer示例。他们的SkeletalViewer的问题是他们紧密地绑定显示和骨架跟踪。这使它很难改变。



使用多个kinect传感器应该是可能的,你只需要以相同的方式初始化所有的传感器。最好的做法是定义一个传感器类来包裹kinect传感器。如果你不需要显示,你可以只写一个新的程序。这有点工作,但不是那么多,你可以得到一个完整的工作程序,在不到100行的多个传感器。如果你需要显示,你可以重写SkeletalViewer示例来使用你的传感器类,但是更繁琐。


I would like to do skeletal tracking simultaneously from two kinect cameras in SkeletalViewer and obtain the skeleton result. As in my understanding, the Nui_Init() only process the threads for first Kinect (which I suppose index = 0). However could I have the two skeletal tracking run at the same time as I would like to output their result respectively into two text files at the same time.

(eg. for Kinect 0 output to "cam0.txt" while Kinect 1 output to "cam1.txt")

Does anyone has experience in such case or able to help?

Regards,

Eva

PS: I read this from Kinect SDK documentation state that:

If you are using multiple Kinect sensors, skeleton tracking works only on the first device that you Initialize. To switch the device being used to track, uninitialized the old one and initialize the new one.

So is it possible if I want to acquire the coordinates simultaneously? Or even if acquire one by one, how should I call them separately? (as I realize the index of the active Kinect will be 0 which I can't differentiate them).

解决方案

I assume that you are using MS SkeletalViewer example. The problem with their SkeletalViewer is that they closely tied the display and the skeleton tracking. This make it difficult to change.

Using multiple kinect sensor should be possible, you just need to initialize all the sensors the same way. The best thing to do would be to define a sensor class to wrap kinect sensors. If you don't need the display, you can just write a new program. That's a bit of work but not that much, you can probably get a fully working program for multiple sensors in less than 100 lines. If you need the display, you can rewrite the SkeletalViewer example to use your sensor class but that's more tedious.

这篇关于如何同时初始化两个Kinect? (SkeletalViewer)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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