一.TUM数据集使用方法

TUM数据集的格式解读地址:https://vision.in.tum.de/data/datasets/rgbd-dataset/file_formats
TUM的RGBD数据集地址: https://vision.in.tum.de/data/datasets/rgbd-dataset/download
文件格式

我们以以下格式提供来自Kinect的RGB-D数据集:
彩色图像和深度地图

我们以gzip格式的tar文件(TGZ)提供带有时间戳的颜色和深度图像。

彩色图像以PNG格式存储为640x480 8位RGB图像。
深度图存储为640x480的16位单色图像PNG格式。
颜色和深度图像已经使用PrimeSense的OpenNI驱动程序预先注册,也就是说,颜色和深度图像中的像素已经对应为1:1。
深度图像按5000的倍数进行缩放,即深度图像中的像素值为5000,对应的距离为相机1米,10000就是2米的距离等。像素值为0表示缺失值/无数据。

真实轨迹

我们将groundtruth轨迹提供为包含摄像机在固定坐标系中的平移和方向的文本文件。请注意,我们的自动评估工具也期望地面真相和估计轨迹都是这种格式。

文本文件中的每一行都包含一个姿势。
每一行的格式为’timestamp tx ty tz qx qy qz qw’
timestamp (float)给出了自Unix时代以来的秒数。
Tx ty tz(3浮动)给出彩色摄像机的光学中心相对于运动捕捉系统定义的世界原点的位置。
Qx qy qz qw(4浮动)给出了彩色摄像机的光学中心的方向,其形式是相对于由运动捕捉系统定义的世界原点的四元数。
该文件可能包含必须以“#”开头的注释。

Kinect固有摄像头校准

Kinect内置了基于高阶多项式翘曲函数的工厂校准。OpenNI驱动程序使用这种校准来校正图像,并将深度图像(由红外相机拍摄)记录到RGB图像中。因此,我们的数据集中的深度图像被重投影到彩色相机的帧中,这意味着深度图中的像素与彩色图像之间存在1:1的对应关系。

从2D图像到3D点云的转换过程如下。注意,焦距(fx/fy),光学中心(cx/cy),失真参数(d0-d4)和深度校正因子对于每个相机都是不同的。下面的Python代码演示了如何从像素坐标和深度值计算3D点:
注意,上面的脚本使用默认的(未校准的)内在参数。fr1和fr2数据集中使用的kinect的内在参数如下:(原文截图)
**Kinect固有摄像头校准**
注意,Freiburg 3 的颜色和红外图像都已经经过了未畸变处理,因此畸变参数均为零。原始的失真值可以在tgz文件中找到。

注意:我们建议使用ROS默认参数集(即不失真),因为预配深度图像的失真并非易事。
ROS袋

对于使用ROS的用户,我们还提供ROS包文件,其中包含彩色图像、单色图像、深度图像、相机信息、点云和变换——包括来自/world框架的groundtruth变换,所有这些都在一个文件中。包文件(ROS diamondback)包含以下消息主题:在这里插入图片描述

二.估文件evaluate_rpe.py和evaluate_ate.py的使用

1.文件下载地址
evaluate_rpe.py地址:

https://svncvpr.in.tum.de/cvpr-ros-pkg/trunk/rgbd_benchmark/rgbd_benchmark_tools/src/rgbd_benchmark_tools/evaluate_rpe.py

evaluate_ate.py 地址:

https://svncvpr.in.tum.de/cvpr-ros-pkg/trunk/rgbd_benchmark/rgbd_benchmark_tools/src/rgbd_benchmark_tools/evaluate_ate.py 

2.说明
翻译地址:https://vision.in.tum.de/data/datasets/rgbd-dataset/tools#evaluation

在对Kinect的摄像机轨迹进行估计并保存到文件后,我们需要通过与地面真实值的比较来评估估计轨迹中的误差。有不同的误差度量。两种比较突出的方法是绝对轨迹误差法(ATE)和相对位姿误差法(RPE)。
该ATE非常适合于测量视觉SLAM系统的性能。
相比之下,RPE非常适合于测量视觉里程计系统的漂移,例如每秒的漂移。

对于这两个指标,我们提供了可以在这里下载的自动化评估脚本。请注意,在我们的网站上还有一个在线版本。两个轨迹必须存储在一个文本文件中(格式:‘timestamp tx ty tz qx qy qz qw’,更多信息)。为了进行比较,我们提供了一组RGBD-SLAM的轨迹。

(1)绝对轨迹误差(ate)

绝对轨迹误差直接测量真实轨迹和估计轨迹之间的点差。作为预处理步骤,我们使用时间戳将估计的姿态与地面真实姿态关联起来。在此基础上,我们利用奇异值分解对真实轨迹和估计轨迹进行对齐。最后,我们计算每对姿势之间的差值,并输出这些差值的平均值/中值/标准差。可选地,脚本可以将两条轨迹绘制为png或pdf文件。

usage: evaluate_ate.py [-h] [--offset OFFSET] [--scale SCALE]
                       [--max_difference MAX_DIFFERENCE] [--save SAVE]
                       [--save_associations SAVE_ASSOCIATIONS] [--plot PLOT]
                       [--verbose]
                       first_file second_file

This script computes the absolute trajectory error from the ground truth
trajectory and the estimated trajectory.

positional arguments:
  first_file            first text file (format: timestamp tx ty tz qx qy qz
                        qw)
  second_file           second text file (format: timestamp tx ty tz qx qy qz
                        qw)

optional arguments:
  -h, --help            show this help message and exit
  --offset OFFSET       time offset added to the timestamps of the second file
                        (default: 0.0)
  --scale SCALE         scaling factor for the second trajectory (default:
                        1.0)
  --max_difference MAX_DIFFERENCE
                        maximally allowed time difference for matching entries
                        (default: 0.02)
  --save SAVE           save aligned second trajectory to disk (format: stamp2
                        x2 y2 z2)
  --save_associations SAVE_ASSOCIATIONS
                        save associated first and aligned second trajectory to
                        disk (format: stamp1 x1 y1 z1 stamp2 x2 y2 z2)
  --plot PLOT           plot the first and the aligned second trajectory to an
                        image (format: png)
  --verbose             print all evaluation data (otherwise, only the RMSE
                        absolute translational error in meters after alignment
                        will be printed)

(2)相对姿态误差(rpe)

为了计算相对姿态误差,我们提供了一个脚本“evaluate_rpe.py”。这个脚本计算时间戳对之间相对运动的误差。默认情况下,脚本会计算估计轨迹文件中所有时间戳对之间的误差。由于估计轨迹中时间戳对的数量是轨迹长度的二次元,因此将该集合向下采样到一个固定的数字(-max_pairs)是有意义的。或者,也可以选择使用固定的窗口大小(-fixed_delta)。在这种情况下,估计轨迹中的每个姿态都会根据窗口大小(-delta)和单位(-delta_unit)与之后的姿态相关联。这种评价技术对估计漂移是有用的。

usage: evaluate_rpe.py [-h] [--max_pairs MAX_PAIRS] [--fixed_delta]
                       [--delta DELTA] [--delta_unit DELTA_UNIT]
                       [--offset OFFSET] [--scale SCALE] [--save SAVE]
                       [--plot PLOT] [--verbose]
                       groundtruth_file estimated_file

This script computes the relative pose error from the ground truth trajectory
and the estimated trajectory.

positional arguments:
  groundtruth_file      ground-truth trajectory file (format: "timestamp tx ty
                        tz qx qy qz qw")
  estimated_file        estimated trajectory file (format: "timestamp tx ty tz
                        qx qy qz qw")

optional arguments:
  -h, --help            show this help message and exit
  --max_pairs MAX_PAIRS
                        maximum number of pose comparisons (default: 10000,
                        set to zero to disable downsampling)
  --fixed_delta         only consider pose pairs that have a distance of delta
                        delta_unit (e.g., for evaluating the drift per
                        second/meter/radian)
  --delta DELTA         delta for evaluation (default: 1.0)
  --delta_unit DELTA_UNIT
                        unit of delta (options: 's' for seconds, 'm' for
                        meters, 'rad' for radians, 'f' for frames; default:
                        's')
  --offset OFFSET       time offset between ground-truth and estimated
                        trajectory (default: 0.0)
  --scale SCALE         scaling factor for the estimated trajectory (default:
                        1.0)
  --save SAVE           text file to which the evaluation will be saved
                        (format: stamp_est0 stamp_est1 stamp_gt0 stamp_gt1
                        trans_error rot_error)
  --plot PLOT           plot the result to a file (requires --fixed_delta,
                        output format: png)
  --verbose             print all evaluation data (otherwise, only the mean
                        translational error measured in meters will be
                        printed)

3.实测使用EVO(参考文章:https://www.freesion.com/article/5474496382/

  1. evo_traj:直接画出轨迹

(1)单独绘制轨迹:evo_traj tum KeyFrameTrajectory.txt -p
(2)将多个轨迹画到一起 : evo_traj tum KeyFrameTrajectory.txt CameraTrajectory2.txt --ref CameraTrajectory2.txt -va -p
或者: evo_traj tum KeyFrameTrajectory.txt CameraTrajectory2.txt --ref KeyFrameTrajectory.txt -va -p
参考的基准轨迹不一样,所以这俩个命令绘制出的轨迹不完全一样;
其中ref是参考轨迹,-va是对齐后的详细信息,-p是画出图像

(3)也可以使用–plot_mode {xy,xz,yx,yz,zx,zy,xyz}来选择单独绘制某个平面的信息
如:evo_traj tum KeyFrameTrajectory.txt CameraTrajectory2.txt --ref KeyFrameTrajectory.txt -va -p --plot_mode=xy

  1. evo_ape:绝对位姿误差的计算

evo_ape tum KeyFrameTrajectory.txt KeyFrameTrajectory.txt -va -p
使用ape的时候无需给出–ref 的文件,tum 后第一个文件即为标准文件,也就是:evo_ape tum 真实.txt 测试.txt -va -p

  1. evo_rpe:相对位姿误差的计算

evo_rpe tum KeyFrameTrajectory.txt KeyFrameTrajectory.txt -va -p

使用rpe的时候无需给出–ref 的文件,tum 后第一个文件即为标准文件,也就是:evo_rpe tum 真实.txt 测试.txt -va -p

  1. 其他参数

将文件保存为其他类型的文件,可以使用如下句柄

–save_as_tum save trajectories in TUM format (as *.tum)
–save_as_kitti save poses in KITTI format (as *.kitti)
–save_as_bag save trajectories in ROS bag as .bag

保存图片 --save_plot “保存的路径”
合并轨迹 --merge
给出数据的最大时间戳差异 --t_max_diff “具体差异”

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐