3D Point Cloud with the Kinect
- Posted: Apr 30, 2012 at 6:00 AM
- 11,352 Views
- 6 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
3D point clouds seem to be pretty popular with the Kinect so when I saw this article that talks about it in good depth...
A point cloud is a set of points in a 3D space. You can view the cloud from different angles and lighting conditions. You can even apply colors and textures to its surfaces. A point cloud is one step away from a full 3D model and sometimes it is more useful.
One of the things that every Kinect programmer will be keen to try out is using the depth map to create a 3D point cloud. This is relatively easy in principle, but there are so many fine details you need to get right that it can be more difficult than you expect.
So far we have been plotting the depth field using 2D graphics, using color or brightness to give the depth of each pixel. Now we need to use the depth information supplied by the Kinect to construct a true 3D model of the scene.This can then be viewed in the usual way.
The first problem we have is deciding how to work with 3D using C#. There is no obvious choice for a 3D framework in managed code and the situation with Windows Forms is even more complicated and difficult. There is no official library to allow you to make use of DirectX from C#. Essentially there are two main choices - XNA or WPF. The details of using 3D are more or less the same between XNA and WPF and which is best depends on the rest of the application. In many ways WPF is the simpler of the two so let's start with it.
The results are more impressive when you view a moving 3D image rather than a static screenshot, but there are a few things you need to understand about the image. The first is that areas that have no points are either to far away or too close. Each point in the depth field is positioned at a particular depth and because of the perspective projection the this makes it appear to leave a sort of shadow if itself in the background as triangles are x,y displaced in the image.
You can also get some interesting results by placing the view camera at an angle to the z direction. which is the direction the Kinect is pointing in. This allows you to look sideways at the depth image.
Project Source URL: http://www.i-programmer.info/codebin.html (Registration required)