繁体   English   中英

调用目标抛出了Kinect异常

[英]Kinect exception has been thrown by the target of an invocation

我正在尝试将我的Kinect SDK升级到新版本并遇到一些我无法理解的麻烦。

它一到达kinectSensor.SkeletonFrameReady += this.KinectAllFramesReady;

private KinectSensor kinectSensor;

public MainWindow()
{
    InitializeComponent();

    kinectSensor.SkeletonFrameReady += this.KinectAllFramesReady;
    kinectSensor.SkeletonStream.Enable(new TransformSmoothParameters()
    {
        Smoothing = 0.5f,
        Correction = 0.5f,
        Prediction = 0.5f,
        JitterRadius = 0.05f,
        MaxDeviationRadius = 0.04f
    });
    kinectSensor.Start();
}

已经在评论中解决了,但对于遇到同样问题的人来说答案更好;

代码的问题在于它声明了kinectSensor变量,但从未将其设置为任何东西。 MSDN Social上有关于如何检测连接/断开连接设备的一个非常好的代码示例,但是一个非常简单的版本只是为了开始使用静态KinectSensor.KinectSensors集合中的第一个条目,这将是你的第一个连接传感器。

暂无
暂无

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

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