简体   繁体   中英

Cannot Close Kinect v2 in Windows Store App

I have a project built in Unity3D using the Kinect v2. I can turn the Kinect on and off by using the dlls provided by microsoft and calling

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

to turn the Kinect on, and

_Sensor.Close();

to Turn the Kinect off.

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

Kinect does not Close in Windows Store apps. This is an SDK bug.

Windows Store apps use WindowsPreview.dll instead of Microsoft.Kinect.dll.

Seems that WindowsPreview.dll does not support closing the sensor.

I do not think there are much you can do.

Dispose your resources and set everything to null when you need to close. ColorFrameReader, DepthFrameReader, InfraredFrameReader, BodyFrameReader should be disposed. There is a Dispose method for each frame reader.

Also, unsubscribe from any FrameArrived events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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