# Kinect Point Cloud Normals Rendering – Part 4

In this post I’ll create a WPF front-end to the C++ template code I’ve been using so far. I’ll use a CLR wrapper to achieve this. The first step is to create a WPF project. I like to use MVVM Light Toolkit for my WPF projects. I’ve installed the Visual Studio plugin so it comes up as on option when I’m creating a new project. I started by created a project called DepthViewer2D: Once I created this project I added a new project to the solution called DepthImageRenderer. This is a C++/CLR class library project. You’ll find it under “Other…

# Kinect Point Cloud Normals Rendering – Part 3

In this post I’ll add to further methods for calculating the normals of the depth point cloud. In the previous point I showed how to calculate the normal of a point using the point directly above and the point directly to the left. We can obtain smoother normals by looking at 4 points that surround – those that are above, below, to the left, to the right. Here’s a picture showing the grid of the points that surround our current point. I’ve labelled the points we’ll be considering as A, B, C and D: We calculate the normals of each…

# Kinect Point Cloud Normals Rendering – Part 2

Having shown you how to create a 3D point cloud from a Kinect depth map in Part 1 I will now go on to explain how to calculate the normals for that point cloud and then render that in 2D by mapping the (x,y,z) normal vector values to R-G-B channel values. To calculate the normal for a given 3D point in the point cloud we will use the point directly to the left of it (i.e. at the point (x-1,y)) and the point directly above it (i.e. at the point (x,y-1)). We will create a triangle of the 3 points…

# Parallel Processing and Lambda expressions in C++11 – Part 2

If you’ve made the changes to the code from Part 1 then you already have code that should be working dramatically faster. In the next steps I’m going to use C++ templates to further enhance the code. I love C++ templates! I try and use them whenever I can. One of the great things about them is that only the code that is actually used gets generated and compiled. And with C++11 you’ve got the ability to use lambda functions in templates. This is useful if you’re using STL. It’s also useful for us here. Before I do that I…