Seeing in low light

As we all know, IR is invisible to the human eye as it has a longer wavelength than the highest wavelength that a human eye can see in a spectrum. This same disadvantage of human beings is used as an advantage by using an IR light to see in the dark. The Kinect SDK provides an API that can help us read the same data.

Capturing IR stream data is as simple as capturing a color image stream, as the SDK returns the infrared stream as a part of the color image stream data. The only changes are ColorImageFormat and PixelFormats. You can simply change the following two sections in the code block that we have discussed in the Capturing color image from the Kinect camera section.

  1. Enable the ColorStream with InfraredResolution640x480Fps30:
    this.sensor.ColorStream.Enable(ColorImageFormat.InfraredResolution640x480Fps30);
  2. Set the PixelFormats to Gray16 while creating the bitmap source as assigning it to image control:
    this.VideoControl.Source = BitmapSource.Create(
    imageFrame.Width, imageFrame.Height, 96,96,
    PixelFormats.Gray16,
    null, pixelData, stride);

That's all! After all the previous changes are done, run your application; you will find the video stream data full of IR dots. It will be quite fun if you do this testing in a dark room, because the IR will still help to capture the grayscale image:

Seeing in low light

Note

Apart from using the infrared stream to capture images in low light, you can use this to calibrate the cameras while you are using multiple Kinect sensors or using the Kinect camera with other camera devices.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.69.143