How to convert Kinect raw depth info to meters in Matlab?

前端 未结 1 1784
时光说笑
时光说笑 2021-01-01 06:30

I have made some research here to understand this topic but I have not achieved good results. I\'m working with a Kinect for Windows and the Kinect SDK 1.7. I\'m working wit

相关标签:
1条回答
  • 2021-01-01 07:12

    In the second article you read, you will see that the method you use is outdated. Read this.

    x = (i - w / 2) * (z + minDistance) * scaleFactor
    y = (j - h / 2) * (z + minDistance) * scaleFactor
    z = z
    Where
    minDistance = -10
    scaleFactor = .0021.
    These values were found by hand.
    

    Also you could convert those points to millimeters in your first application as described in the second question

    using (var depthFrame = e.OpenDepthImageFrame())
    {
        var depthArray = new short[depthFrame.PixelDataLength];
        depthFrame.CopyPixelDataTo(depthArray);
    
        for (int i = 0; i < depthArray.Length; i++) {
            int depthInMillimeters = 
                depthArray[i] >> DepthImageFrame.PlayerIndexBitmaskWidth;
            // TADAx2!
    }
    
    0 讨论(0)
提交回复
热议问题