Kinect: From Color Space to world coordinates

后端 未结 1 1232
青春惊慌失措
青春惊慌失措 2021-02-09 23:41

I am tracking a ball using the rgb data from kinect. After this I look up the corresponding depth data. Both of this is working splendid. Now I want to have the actual x,y,z wor

1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-10 00:03

    Check the CameraIntrinsics.

    typedef struct _CameraIntrinsics
    {
        float FocalLengthX;
        float FocalLengthY;
        float PrincipalPointX;
        float PrincipalPointY;
        float RadialDistortionSecondOrder;
        float RadialDistortionFourthOrder;
        float RadialDistortionSixthOrder;
    }   CameraIntrinsics;
    

    You can get it from ICoordinateMapper::GetDepthCameraIntrinsics.

    Then, for every pixel (u,v,d) in depth space, you can get the coordinate in world space by doing this:

    x = (u - principalPointX) / focalLengthX * d;
    y = (v - principalPointY) / focalLengthY * d;
    z = d;
    

    For color space pixel, you need to first find its associated depth space pixel, which you should use ICoordinateMapper::MapCameraPointTodepthSpace. Since not all color pixel has its associated depth pixel (1920x1080 vs 512x424), you can't have the full-HD color point cloud.

    0 讨论(0)
提交回复
热议问题