如何重构KinectSensor GetDefault [英] How to refactor KinectSensor GetDefault

查看:91
本文介绍了如何重构KinectSensor GetDefault的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我正在制作的显示器运行两个运动。不幸的是,KinectSensor.Sensors在Kinect SDK 1.0之后被移除了,所以我们所有人都可以访问KinectSensor.GetDefault,它返回计算机的"默认"信息。 Kinect的。
怎么能重构"GetDefault"允许我传入一个设备ID作为参数?

I'm needing to run two kinects for a display piece I'm working on. Unfortunately the KinectSensor.Sensors was removed after Kinect SDK 1.0 so all we have access to is KinectSensor.GetDefault which returns the computer's "default" kinect. How can I refactor "GetDefault" to allow me to pass in a device id as a parameter?

推荐答案

如果你想在一台机器上使用两个Kinect,它无法做到。 SDK不支持它,这就是返回多个传感器的KinectSensor.Sensors被GetDefault替换的原因,它只返回一个。如果您想要更改正在使用的两个连接中的两个
,我也不认为这是可能的,因为它不仅仅是您正在编写的应用程序已被更改为仅使用一次传感器操作, KinectService也是如此。 KinectService从
传感器获取原始输入并对其进行处理(主要通过GPU)并以SDK将其提供给最终用户开发人员的方式进行准备,以便在自己的应用程序中使用。

In case you want to use two Kinects on one machine, it can't be done. It's not supported by the SDK, which is why KinectSensor.Sensors which returned multiple sensors got replaced with GetDefault which returns just one. In case you want to have two of them connected while changing the one being used, I also don't think it's possible since it's not just the application you're writing that's been changed to operate with just once sensor, but the KinectService as well. KinectService grabs the raw input from the sensor and processes them(via GPU mostly) and prepares them in the way the SDK gives them to the end-user developer for use in their own applications.

所以基本上它不只是一台机器上的许多操作传感器,而是每台机器只有一个传感器。

So basically it's not just one operating sensor out of many on one machine, but really only one sensor per machine.

我不知道认为你有可能重写它。执行此操作的代码部分可能位于已关闭的源dll中。接近这种情况的方法是通过多台带有Kinects的机器和某种peer2peer或客户端服务器
设置。

I don't think it's possible for you to rewrite it. The part of the code that does that is probably inside the closed source dll. The way to do approach such a scenario is only through multiple machines with Kinects and some kind of peer2peer or client server setup.


这篇关于如何重构KinectSensor GetDefault的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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