none
Kinect Image Stream is null RRS feed

  • Question

  • Hi threre,

    I'm new in developing Kinect Software. For my first steps I'm using the Kinect for Windows Programming Guide. I wrote a little application in C# for capturing the image stream of Kinect sensor.

    After starting the sensor with:

    KinectSensor sensor;
    sensor = KinectSensor.KinectSensors[0];
    sensor.Start();
    sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);

    I do the image processing with the ColorFrameReady EventHandler.

    void sensor_ColorFrameReady(object sender, ColorImageFrameReadyEventArgs e)
    {
    	using(ColorImageFrame imageFrame = e.OpenColorImageFrame())
    	{
    	if(imageFrame == null)
    	{
    		return;
    	}
    	// do image processing
    	}
    }

    This works fine after starting the application. But if I try to change the ImageFormat on the fly with:

    sensor.ColorStream.Enable(ColorImageFormat.InfraredResolution640x480Fps30);
    I only get one picture from the Kinect sensor and then every further ImageFrame is null. What could be the reason for this? Any ideas?

    Thursday, April 11, 2013 10:53 PM

Answers

  • I have figured out that the sensor is sending his data too fast for my application in c sharp! With a 32 bit value for every pixel, the application has enough time to work through the incoming data before the next event handler callback appears. But with the 16 bit value for every pixel in depth image and infrared image the application doesn't seem to have enough time to go through the event handler function. And before it had the time to go through the function the next event handler appears, tries to send his next pictureframe where the buffer isn't already ready to get the next frame. I think this is why every further imageframe is null. Changing to the on demand concept solves the problem.
    Saturday, April 13, 2013 6:25 AM