在TUM RGB-D基准

时间:2017-07-31 08:59:06

标签: algorithm dataset benchmarking slam

我从TUM RGB-D SLAM Dataset and Benchmark下载了Freiburg桌面数据集并将其转换为'。klg',这是slam算法的自定义格式。我将这个klg文件加载到ElasticFusion并运行SLAM算法。这样做时,3d重建输出似乎已经足够好了。

enter image description here

现在我想通过已经建立的轨迹信息来构建三维重建。 我从'。freibrug'中检索了之前运行的轨迹数据,并通过ElasticFusion将其转换为所需的格式。我刚刚将时间戳从秒变为微秒,将其乘以1000000.并使用“,”而不是“”space 来拆分变量。 我这次使用“-p”标志运行算法,并将路径信息运行到轨迹文件。下面是我的跑步命令。

/path_to_EF/./ElasticFusion -l /path_to_data/rgbd_dataset_freiburg1_desk/test2.klg -p /path_to_data/rgbd_dataset_freiburg1_desk/modified_freiburg.txt

我期待获得相同的点云。但是我得到的结果远远超出了预期的数据。

enter image description here

正如您所看到的,它的准确性和重建水平远远低于之前的运行水平。 我对弹道没有问题。下图显示我从上一次运行中检索到的轨迹接近TUM RGB-D Benchmark提供的groundtruth数据。

enter image description here

即使我使用groundtruth数据运行它,它也不会构建漂亮的3D重建。这种结果可能是什么原因和缺失点?

我们将非常感谢您提出好的建议和答案。

2 个答案:

答案 0 :(得分:0)

我用轨迹文件成功运行了代码 (您的时间戳应该是整数,并用空格分隔所有参数) 修改ElasticFusion/GUI/src/Tools/GroundTruthOdometry.cpp

void GroundTruthOdometry::loadTrajectory(const std::string & filename)
{
    std::ifstream file;
    std::string line;
    file.open(filename.c_str());
    while (!file.eof())
    {
        unsigned long long int utime;
        float x, y, z, qx, qy, qz, qw;
        std::getline(file, line);
        int n = sscanf(line.c_str(), "%llu %f %f %f %f %f %f %f", &utime, &x, &y, &z, &qx, &qy, &qz, &qw);

        if(file.eof())
            break;

        assert(n == 8);

        Eigen::Quaternionf q(qw, qx, qy, qz);
        Eigen::Vector3f t(x, y, z);

        Eigen::Isometry3f T;
        T.setIdentity();
        T.pretranslate(t).rotate(q);
        camera_trajectory[utime] = T;
    }
}

Eigen::Matrix4f GroundTruthOdometry::getTransformation(uint64_t timestamp)
{
    Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();

    if(last_utime != 0)
    {
        std::map<uint64_t, Eigen::Isometry3f>::const_iterator it = camera_trajectory.find(last_utime);
        if (it == camera_trajectory.end())
        {
            last_utime = timestamp;
            return pose;
        }


        pose = camera_trajectory[timestamp].matrix();
    }
    else
    {
        std::map<uint64_t, Eigen::Isometry3f>::const_iterator it = camera_trajectory.find(timestamp);
        Eigen::Isometry3f ident = it->second;
        pose = Eigen::Matrix4f::Identity();
        camera_trajectory[last_utime] = ident;
    }

    last_utime = timestamp;

    return pose;
}

基本上只是禁用M矩阵,你可以试试

答案 1 :(得分:-1)

我进行了3次扫描:从左到右,从上到下,从后到前。我观察到思想轨迹文件似乎是正确的,建筑物出错了。当我在x轴上移动相机时,在EF上它会在z轴上移动,而在其他情况下也会发生类似的情况。我试图手动找到转换矩阵。我将此转换应用于平移和旋转。之后它开始起作用了。