首页 文章

Kinect v2,3D点 Cloud 投影到彩色图像

提问于
浏览
0

我正在使用Kinect V2捕获3D点 Cloud 及其相应的彩色图像 . 为了将一些3D模型正确投影到这个彩色图像中,我需要从相机到图像空间计算有效的投影矩阵 . 由于Kinect V2 SDK没有关于RGB相机的校准信息,我发现有一个方法叫做 MapCameraPointsToColorSpace 在coordinateMapper类中 .

此方法返回一个Lookup表,其中包含 Cloud 中每个3D点与图像像素之间的对应关系 . 从表中,我曾试图计算RGB相机内在矩阵(焦距,主点,图像间距因子) . 但是,通过使用计算的内部矩阵和Lookup表中的值投影的2D点之间存在一些误差 . 我认为发生这个错误是因为我没有计算径向失真 . 我对吗?我应该关心径向失真,以通过此查找表获得3D到2D色点之间的精确映射吗?

1 回答

  • 0

    是的,你是对的 . 原始Kinect RGB图像具有失真 . 最好的方法是首先使用RGB相机内部矩阵手动扭曲空白图像,并将其用作查找表 .

    distort(int mx, int my, float& x, float& y) const
        {
            float dx = ((float)mx - depth.cx) / depth.fx;
            float dy = ((float)my - depth.cy) / depth.fy;
            float dx2 = dx * dx;
            float dy2 = dy * dy;
            float r2 = dx2 + dy2;
            float dxdy2 = 2 * dx * dy;
            float kr = 1 + ((depth.k3 * r2 + depth.k2) * r2 + depth.k1) * r2;
            x = depth.fx * (dx * kr + depth.p2 * (r2 + 2 * dx2) + depth.p1 * dxdy2) + depth.cx;
            y = depth.fy * (dy * kr + depth.p1 * (r2 + 2 * dy2) + depth.p2 * dxdy2) + depth.cy;
    }
    

    For more information

相关问题