コード例 #1
0
        public void SetImage(ColorDepthImage image)
        {
            const float MM_UNITY_CONV = 800.0f;

            //Creates the projection and array to populate
            imageProj  = SMInstance.CaptureManager.Device.CreateProjection();
            depthArray = new Point3DF32[image.DepthImage.height * image.DepthImage.width];

            //Iterates through each of the pixels and places them in the appropriate array
            var dImageArray = image.DepthImage.GetPixels();

            for (int i = 0; i < depthArray.Length; i++)
            {
                depthArray[i].x = i % WIDTH;
                depthArray[i].y = i / WIDTH;
                depthArray[i].z = dImageArray[i].grayscale;
            }

            //Performs the conversion
            pointArray = new Point3DF32[WIDTH * HEIGHT];
            imageProj.ProjectDepthToCamera(depthArray, pointArray);

            //Scales the units
            for (int i = 0; i < pointArray.Length; i++)
            {
                pointArray[i].x *= MM_UNITY_CONV;
                pointArray[i].y *= MM_UNITY_CONV;
                pointArray[i].z *= MM_UNITY_CONV;
            }

            //Releases resources
            imageProj.Dispose();
        }
コード例 #2
0
 public void SetImage(ColorDepthImage image)
 {
     return;
 }