none
exception while enable the SkeletonStream when I was using two kinects RRS feed

  • Question

  •  static void Main(string[] args)
            {
                List<KinectSensor> kinects = new List<KinectSensor>();
                List<SkeletonStream> skStream = new List<SkeletonStream>();
                List<ColorImageStream> rgbStream = new List<ColorImageStream>();
    
                List<DepthImageStream> depthStream = new List<DepthImageStream>();
    
                foreach(KinectSensor sensor in KinectSensor.KinectSensors){
                    SkeletonStream sstream = sensor.SkeletonStream;
                    DepthImageStream dstream = sensor.DepthStream;
                    ColorImageStream rstream = sensor.ColorStream;
                    sensor.Start();
                    dstream.Enable(DepthImageFormat.Resolution640x480Fps30);
                    rstream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
                    sstream.Enable();
                    depthStream.Add(dstream);
                    rgbStream.Add(rstream);
                    skStream.Add(sstream);
                    kinects.Add(sensor);
                }
                
               string read= Console.ReadLine();
            }
    

    I am developing a application in which will use two kinect at the same time.But when I initial the twoo kinects. there will throw an exception at the line "sstream.Enable();".

    In another word, I tried two enable the SkeletonStream of  two kinects, but it will throw an  exception when the code run to the sstream.Enable();" at the second time. the exception is shown in the picture.

    • Moved by Bob Shen Friday, March 23, 2012 7:32 AM (From:Visual C# General)
    Wednesday, March 21, 2012 10:00 AM

All replies