Kinect初始化 [英] Kinect initialization

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

问题描述

几周前,
一篇文章
 其中包含一些开发技巧,已发布在Kinect for Windows Blog中。

A couple of weeks ago, an article that included some tips for development was published in Kinect for Windows Blog.

其中一个提示是:

- "初始化Kinect传感器对象和WPF窗口的Form Loaded事件处理程序中的所有读者,而不是构造函数"。

- "Initialize the Kinect sensor object and all readers in the Form Loaded event handler of a WPF window, not the constructor".

但是,我会说在SDK演示中,这些任务通常在MainWindow构造函数中执行,其中一些任务在构造函数和窗口加载处理程序之间共享。

However, I would say that in SDK demos these tasks are usually performed in the MainWindow constructor and in some of them they're shared between constructor and window loaded handler.

是否有任何真正的区别?为什么一种方法应该优先于另一种方法?

Is there any real difference? Why an approach should be preferred to another?

推荐答案

我会对这个话题进行权衡......

I'll weigh in on this topic...

我想说这一切都取决于你对启用Kinect的应用程序的使用情况。假设是,如果您正在构建WPF应用程序,则可以选择使用Kinect交互控件。如果是这种情况,这些控件和类似的基于UI的
控件更多地关注事件模型。使用此模型时,最佳方法和建议操作是在WPF窗口和句柄有效的时间点开始使用Kinect设备,以便为用户控件消耗
来抽取这些事件。这通常是在Form Loaded事件期间。

I would say this all depends on your usage of the Kinect enabled application. The going assumption is that if you're building a WPF application, you may opt to use the Kinect Interaction Controls. If this is the case, these controls and similar UI based controls are focused more on the Event model. The best approach and recommended action when working with this model is to start using the Kinect device during a point in time where the WPF window and handles are valid for pumping these event for consumption of the user controls. This is typically during the Form Loaded event.

另一方面,如果您正在构建WPF应用程序,并且您没有使用事件模型本身,而是其他一些非相关的UI功能,比如另一个绘图引擎的容器让我们说DirectX,你正在使用游戏玩家的循环。这种模式更多是
,专注于状态轮询,这通常意味着Kinect对象或读者需要在循环之前可用。

On the other hand if you're building a WPF application, and you're not using the event model per se, but some other non-related UI feature such as a container for another Drawing engine let's say DirectX, you're using the gamer's loop. This pattern is more focused on polling for states which usually means the Kinect object or readers need to be available prior to the loop.


这篇关于Kinect初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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