4

Kinect センサーによって返される深度値は、xy 平面からの現実世界の z 距離 (mm) に対応します。これまでのところ、x 座標と y 座標に類似したものを返す最新の sdk には何も見つかりません。これは SDK で提供されますか? それができない場合、x と y を計算する良い方法は何でしょうか?

4

1 に答える 1

6

SkeletonPoint を返す KinectSensor.MapDepthToSkeletonPoint メソッドを使用できます。サンプルコードは次のとおりです。

using (DepthImageFrame depthimageFrame = e.OpenDepthImageFrame())
        {
            if (depthimageFrame == null)
            {
                return;
            }

            pixelData = new short[depthimageFrame.PixelDataLength];

            depthimageFrame.CopyPixelDataTo(pixelData);

            for (int x = 0; x < depthimageFrame.Width; x++)
            {
                for (int y = 0; y < depthimageFrame.Height; y++)
                {
                        SkeletonPoint p = sensor.MapDepthToSkeletonPoint(DepthImageFormat.Resolution640x480Fps30, x, y, pixelData[x + depthimageFrame.Width * y]);                        
                }
            }

        }
于 2012-06-20T19:26:54.473 に答える