none
How to always get all Frames from the Kinect --- Some MultiSourceFrameReader XFrameReference Frames are null RRS feed

  • Question

  • Hi,

    i want to capture all (color/depth/ir/body) frames and record them.

    But i struggle to get them all. As far as i know the MultiSourceFrameReader is the way to got, cause it brings me synced frames, but i always got the problem that some of those XFrameReference.AcquiteFrame() functions return null values.

    According to this post missing some frames (null) are cause by to long processing time ( https://social.msdn.microsoft.com/Forums/en-US/1ddbc960-d0a4-4a9f-b73e-a0d4ec8abee6/kinect-multisourceframe-how-to-use-c?forum=kinectv2sdk )

    So i should copy the data from a Xframe as fast as possible and release the frame ?

    But even when i use a minimal example like that below, i still got some frames  which are null. Ive tryed different using/Dispose() setups, but all of them went the same, ive miss some ColorFrame  and more DepthFrames ( Total/color/depth/ir 18600 18560 18414 18411 )

    var reference = e.FrameReference.AcquireFrame();
    
                using (var frame = (ColorFrame)reference.ColorFrameReference.AcquireFrame()) {
                    using (var frame1 = (DepthFrame)reference.DepthFrameReference.AcquireFrame())
                    {
                        using (var frame2 = (InfraredFrame)reference.InfraredFrameReference.AcquireFrame())
                        {
    
                            if (frame != null)
                                {
                                    totalFramesColor++;
                                      // frame.CopyConvertedFrameDataToArray(pixels, ColorImageFormat.Bgra);
                        
                                }
                            if (frame1 != null)
                            {
                                totalFramesDepth++;
                               // frame1.CopyFrameDataToArray(depthData);
                            }
                            if (frame2 != null)
                            {
                                totalFramesInfra++;
                              //  frame2.CopyFrameDataToArray(irData);
                            }
                        }              
                    }     
                }

    I even loosing some more if uncomment the CopyDataLines

    Friday, December 2, 2016 11:30 AM

All replies

  • Can you tell us the specs of the machine you use for development?
    Friday, December 2, 2016 7:01 PM
  • Well, is it "just" a problem of missing performance?

    Specs:

    i7-4700MQ

    8gb RAM

    GTX 765M

    Monday, December 5, 2016 1:36 PM
  • I guess from the M in the VGA you have a laptop. I asked because usually in laptops the power plan is a problem. Set it to High Performance for starters and retry.

    Usually it's set to balanced or low consumption or whatever and Kinect is super greedy about its resources including how much power goes into the transfer of data. So these kinds of plans hinder the transfer of data greatly.

    Monday, December 5, 2016 1:55 PM
  • I guess from the M in the VGA you have a laptop. I asked because usually in laptops the power plan is a problem. Set it to High Performance for starters and retry.

    Usually it's set to balanced or low consumption or whatever and Kinect is super greedy about its resources including how much power goes into the transfer of data. So these kinds of plans hinder the transfer of data greatly.

    Well yes it is a laptop.

    It was already running on some kind of custom high performance setting ( by samsung).

    I made a short test :

    samsung high performance vs (default) high performance setting:

    3000 2998 2995 2994 vs 3000 3000 2997 2996

    I still loose some frames. I will make a long time test tomorrow, but did someone got some more idears ?

    Monday, December 5, 2016 5:30 PM
  • Check this thread out. It's kind of an official troubleshooting guide. Especially the part about the USB settings inside the Advanced Settings of the power plan.

    On another note, have you tried running Kinect Configuration Verifier or Kinect Studio and seeing whether they have problems too? Configuration Verifier might show you an erratic FPS if there's a problem in general.

    Monday, December 5, 2016 5:36 PM