简体   繁体   English

无法在Windows应用商店应用中关闭Kinect v2

[英]Cannot Close Kinect v2 in Windows Store App

I have a project built in Unity3D using the Kinect v2. 我有一个使用Kinect v2在Unity3D中构建的项目。 I can turn the Kinect on and off by using the dlls provided by microsoft and calling 我可以通过使用微软提供dll和调用来打开和关闭Kinect

_Sensor = KinectSensor.GetDefault();
_Sensor.Open();

to turn the Kinect on, and 打开Kinect,和

_Sensor.Close();

to Turn the Kinect off. 关掉Kinect。

When its on, the two lights are on. 当它打开时,两个指示灯亮起。 When its off the two lights are off. 当它关闭两个灯都关闭。 This is how it acts on my windows 8.1 machine in the Unity editor (using the x86 dll), however when I run it on a surface pro, or as a windows store app on my windows 8.1 machine (using the metro dll) only the light by the Camera turns off and the light on the right stays on, also the Kinect and the surface pro heat up, so it seems to be still processing the skeleton / depth data constantly, which is what i want to avoid 这是它在Unity编辑器(使用x86 dll)中对我的Windows 8.1机器的作用,但是当我在表面专业版上运行它,或者作为Windows 8.1机器上的Windows应用程序应用程序(使用metro dll)时,只有相机的光线熄灭,右边的​​灯光也一直亮着,Kinect和表面也会升温,所以它似乎仍在不断地处理骨架/深度数据,这就是我想要避免的

Kinect does not Close in Windows Store apps. Kinect在Windows应用商店应用中不会关闭。 This is an SDK bug. 这是一个SDK错误。

Windows Store apps use WindowsPreview.dll instead of Microsoft.Kinect.dll. Windows应用商店应用使用WindowsPreview.dll而不是Microsoft.Kinect.dll。

Seems that WindowsPreview.dll does not support closing the sensor. 似乎WindowsPreview.dll不支持关闭传感器。

I do not think there are much you can do. 我认为你无能为力。

Dispose your resources and set everything to null when you need to close. 处理您的资源并在需要关闭时将所有内容设置为null。 ColorFrameReader, DepthFrameReader, InfraredFrameReader, BodyFrameReader should be disposed. 应该处理ColorFrameReader,DepthFrameReader,InfraredFrameReader,BodyFrameReader。 There is a Dispose method for each frame reader. 每个帧读取器都有一个Dispose方法。

Also, unsubscribe from any FrameArrived events. 此外,取消订阅任何FrameArrived事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM