I found out the answer. I used a depth image that is not real world coordinates. I used the CoordinateMapper class in the Kinect SDK to convert the depth image to SkeletonPoints, which are real-world coordinates.
It will look something like this:
using (DepthImageFrame depthFrame = e.OpenDepthImageFrame()) { DepthImagePixel[] depth = new DepthImagePixel[depthFrame.PixelDataLength]; SkeletonPoint[] realPoints = new SkeletonPoint[depth.Length]; depthFrame.CopyDepthImagePixelDataTo(depth); CoordinateMapper mapper = new CoordinateMapper(sensor); mapper.MapDepthFrameToSkeletonFrame(DEPTH_FORMAT, depth, realPoints); }
source share