Capturing and processing depth data
To capture the depth data from the Kinect sensor, the program should use exactly the same flow as we used to read the color data stream in the previous chapters.
Enable the depth stream channel with the type of depth image format.
Attach the event handler to the stream channel.
Process the incoming depth frames.
Render the frames on UI.
To start with, you can build a basic WPF application that can capture the raw depth stream and display it. We will extend this application, going forward to explore other features of depth data such as calculating distance and finding player indexes. Perform the following steps to set up a blank project for your DepthCam application:
Start a new instance of Visual Studio.
Create a new project by navigating to File | New Project.
You will see the New Project dialog box. Choose Visual C# as your development language, select WPF Application Template, and type the name as
DepthCam
.From Solution Explorer, right-click on the References...