Performance Kinect颜色和深度流性能

Performance Kinect颜色和深度流性能,performance,colors,xna,kinect,Performance,Colors,Xna,Kinect,我正在开发一个XNA游戏。在我的游戏中,我使用Kinect的颜色流和深度流只获取玩家的图像。为此,我检查了深度像素,并找到了PlayerIndex>0的像素。然后使用MapDepthPointToColorPoint方法将这些深度点映射到颜色点,并从彩色视频中获取这些像素的颜色 这是正常工作,但性能非常差,特别是当这是一个游戏。当我关闭颜色流并设置黑色像素时,我指的是带有播放器索引的像素,它是平滑的。但当我启用颜色流时,效果不是很好 为此,我在AllFramesReady函数中尝试了两种方法:

我正在开发一个XNA游戏。在我的游戏中,我使用Kinect的颜色流和深度流只获取玩家的图像。为此,我检查了深度像素,并找到了PlayerIndex>0的像素。然后使用MapDepthPointToColorPoint方法将这些深度点映射到颜色点,并从彩色视频中获取这些像素的颜色

这是正常工作,但性能非常差,特别是当这是一个游戏。当我关闭颜色流并设置黑色像素时,我指的是带有播放器索引的像素,它是平滑的。但当我启用颜色流时,效果不是很好

为此,我在AllFramesReady函数中尝试了两种方法:

一,-

2-

第二个似乎有更好的性能,因为它在使用块之外应用颜色和深度逻辑,并尽快将资源返回给Kinect。但是,当第二个玩家进来时,性能会急剧下降。但有时当我使用第二个选项时,玩家的图像会消失1到2帧


我还可以做些什么来提高颜色和深度流的性能?感谢您的帮助。

您使用MapDepthPointToColorPoint而不是MapDepthFrameToColorFrame有什么原因吗?我认为最新的Kinect SDK中不推荐使用MapDepthPointToColorPoint。
   using (ColorImageFrame colorVideoFrame = imageFrames.OpenColorImageFrame()) 
   {
      //color logic
   }
   using (DepthImageFrame depthVideoFrame = imageFrames.OpenDepthImageFrame()) 
   {
      //depth logic 
   }
   using (ColorImageFrame colorVideoFrame = imageFrames.OpenColorImageFrame()) 
   {
      colorReceived=true;
   }
   if (colorReceived){
      //color logic
   }
   using (DepthImageFrame depthVideoFrame = imageFrames.OpenDepthImageFrame()) 
   {
      depthReceived=true; 
   }
   if (depthReceived){
      //depth logic
   }