我正在遵循 kinect 工具包中的代码来记录和重放帧,我知道问题是它永远无法识别新的 replay_SkeletonFrameReady,因此我无法绘制我记录的骨架。请注意,我从中读取的文件中确实有数据(数据也通过 kinect 工具包方法保存)。
void replay_SkeletonFrameReady(object sender, ReplaySkeletonFrameReadyEventArgs e)
{
//..The code never makes it to this part, why is this?
processFrame(e.SkeletonFrame);
}
private void processFrame(ReplaySkeletonFrame frame)
{
if (frame != null)
{
skeletonsReplay = new Skeleton[frame.Skeletons.Length];
skeletonsReplay = frame.Skeletons;
Console.WriteLine("attempting draw");
drawMe(); //..Function that draws skeleton
}
}
private void LaunchReplay()
{
Console.WriteLine("replay launched");
Stream readFS = File.OpenRead(@Global.localDirectory +
"\\localStorage\\MySwing.replay");
replay = new KinectReplay(readFS);
//..This line of code should cause the first function to be called right?
replay.SkeletonFrameReady += replay_SkeletonFrameReady;
replay.Start();
}