点云仅部分呈现

时间:2016-03-26 21:12:16

标签: google-project-tango

我只得到房间的部分点云。房间的其他部分根本没有渲染。它只看到左边的一部分。我在Unity中使用Point Cloud预制件。当我使用其中一个应用程序时,例如Room Scanner或Explorer,我会得到其他房间。我打算修改我的应用程序的预制作,但到目前为止,我得到了有限的观点。我在64上在Windows 10上使用Unity 5.3.3。

1 个答案:

答案 0 :(得分:1)

将单位相机与深度相机框架对齐 所以对于矩阵dTuc dTuc = imuTd.inverse * imuTdepth * depthTuc

double timestamp = 0.0;
        TangoCoordinateFramePair pair;
        TangoPoseData poseData = new TangoPoseData();

        // Get the transformation of device frame with respect to IMU frame.
        pair.baseFrame = TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_IMU;
        pair.targetFrame = TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_DEVICE;
        PoseProvider.GetPoseAtTime(poseData, timestamp, pair);
        Matrix4x4 imuTd = poseData.ToMatrix4x4();

        // Get the transformation of IMU frame with respect to depth camera frame.
        pair.baseFrame = TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_IMU;
        pair.targetFrame = TangoEnums.TangoCoordinateFrameType.TANGO_COORDINATE_FRAME_CAMERA_DEPTH;
        PoseProvider.GetPoseAtTime(poseData, timestamp, pair);
        Matrix4x4 imuTdepth = poseData.ToMatrix4x4();

        // Get the transform of the Unity Camera frame with respect to the depth Camera frame.
        Matrix4x4 depthTuc = new Matrix4x4();
        depthTuc.SetColumn(0, new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
        depthTuc.SetColumn(1, new Vector4(0.0f, -1.0f, 0.0f, 0.0f));
        depthTuc.SetColumn(2, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
        depthTuc.SetColumn(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

        m_dTuc = Matrix4x4.Inverse(imuTd) * imuTdepth * depthTuc;