From 26e41c217897ccfcc7153fdd450a2b6a04bfd76f Mon Sep 17 00:00:00 2001 From: Nate Lowry Date: Thu, 21 May 2020 17:13:09 -0500 Subject: [PATCH] Fix miscalculated LUT scale factor The fake depth frame is set to 1000mm, but the example code was dividing the transformation result by 1,000,000, making the lookup table values off by a factor of 1000. --- body-tracking-samples/csharp_3d_viewer/PointCloud.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/body-tracking-samples/csharp_3d_viewer/PointCloud.cs b/body-tracking-samples/csharp_3d_viewer/PointCloud.cs index 3f0b0c1a..80db99ff 100644 --- a/body-tracking-samples/csharp_3d_viewer/PointCloud.cs +++ b/body-tracking-samples/csharp_3d_viewer/PointCloud.cs @@ -26,8 +26,8 @@ public static void ComputePointCloudCache(Calibration calibration) { for (int u = 0; u < calibration.DepthCameraCalibration.ResolutionWidth; ++u, k += 3) { - // Divide by 1e6 to store points position per each 1 millimeter of z-distance. - var point = new Vector3(pointCloudBuffer[k], pointCloudBuffer[k + 1], pointCloudBuffer[k + 2]) / 1000000; + // Divide by 1e3 to store points position per each 1 millimeter of z-distance. + var point = new Vector3(pointCloudBuffer[k], pointCloudBuffer[k + 1], pointCloudBuffer[k + 2]) / 1000; pointCloudCache[v, u] = point; } }