RGB - D斯拉姆数据集和基准(RGB-D SLAM Dataset and Benchmark)
- 格式:pdf
- 大小:584.08 KB
- 文档页数:18
基于RGB—D数据的SLAM算法作者:颜义鹏许志强翟漪璇韩金鑫成怡来源:《科技视界》2018年第14期【摘要】本文提出了一种基于RGB-D数据的SLAM算法,通过对相机获取的图像进行ORB特征点的提取与匹配,估计相机运动关系,实现点云拼接,最后会得到全局一致的点云地图和轨迹。
为了消除误差积累引起的干扰,引入通用图优化库g2o,得到光滑的优化轨迹;在后端回环检测的过程中,引入关键帧选取机制,提高点云地图的生成效率,减少其消耗的存储空间。
实验结果表明,本文的研究方法在RGB-D SLAM 算法中具有可行性,并且能够满足实时性要求,具备较高的精度。
【关键词】RGB-D;ORB特征点提取;SLAM;图优化中图分类号: TP391.41 文献标识码: A 文章编号: 2095-2457(2018)14-0152-002DOI:10.19694/ki.issn2095-2457.2018.14.069SLAM algorithm research based on RGB-D dataYAN Yi-peng XU Zhi-qiang ZHAI Yi-xuan HAN Jin-xin CHENG Yi(Tianjin polytechnic university,Tianjin 300387, China)【Abstract】This paper proposes a SLAM algorithm based on RGB-D data. By extracting and matching the ORB keypoints of the images obtained by the camera, the camera motion relationship is estimated and the point clouds are stitched. Finally, a globally consistent point cloud map and trajectory are obtained. In the process of detection of the backend end loop closure, a key frame selection mechanism is introduced to improve the generation efficiency of the point cloud map to reduce the amount of storage space. The experimental results show that the research method of this paper is feasible in the RGB-D SLAM algorithm, and it can meet the real-time requirements with high accuracy.【Key words】RGB-D; ORB keypoint extraction; SLAM; Graph optimization0 引言因激光雷达具有测距精度高的特点,所以早期的Slam多使用激光雷达作为传感器,但激光雷达存在价格昂贵、数据难以处理等固有缺陷。
slam 初始化基准尺度SLAM(Simultaneous Localization and Mapping,同时定位与地图构建)是指机器人在未知环境中实现自主定位和地图构建的技术。
在SLAM中,机器人需要同时完成自身位置的估计和环境地图的构建,这对于实现机器人自主导航和探索具有重要意义。
本文将从SLAM初始化、基准尺度等方面进行详细阐述。
一、SLAM初始化SLAM系统需要在开始工作前对机器人的初始位置进行估计,这个过程称为初始化。
通常情况下,SLAM系统通过激光雷达或摄像头获取环境信息,并通过特征点匹配或视觉里程计算法来确定机器人的初始位置。
具体来说,可以采用以下方法:1. 利用激光雷达获取环境信息激光雷达可以扫描环境并生成点云数据,这些数据包含了环境中物体的位置和形状等信息。
利用这些数据可以进行特征提取和匹配,从而确定机器人的初始位置。
2. 利用摄像头获取环境信息摄像头可以获取图像信息,在SLAM系统中常用的方法是利用视觉里程计算法来估计机器人的位姿。
该算法通过比较相邻帧之间的图像特征点来计算机器人的位移和旋转,从而确定机器人的初始位置。
二、基准尺度基准尺度是指在SLAM系统中用来测量物体大小和距离的标准单位。
在SLAM系统中,需要对环境进行三维重建,因此需要知道物体的实际大小和距离。
基准尺度通常通过以下方法确定:1. 利用已知物体进行测量可以利用已知大小的物体(如标定棋盘)进行测量,从而确定相机或激光雷达的内外参数。
利用这些参数可以计算出环境中物体的实际大小和距离。
2. 利用GPS进行测量GPS可以提供位置信息,因此可以利用GPS来确定机器人在地球坐标系下的位置。
利用这些信息可以计算出环境中物体的实际大小和距离。
三、SLAM系统构建流程SLAM系统构建流程主要包括以下步骤:1. 传感器数据采集:通过激光雷达、摄像头等传感器获取环境信息。
2. 特征提取与匹配:根据传感器数据提取特征点,并将其与之前获取到的特征点进行匹配。
基于鱼眼相机和RGBD相机的异构协同SLAM基于鱼眼相机和RGB-D相机的异构协同SLAM摘要:SLAM(Simultaneous Localization and Mapping)是自主导航和环境建模中的重要技术。
本文提出了一种使用异构传感器——鱼眼相机和RGB-D相机进行协同SLAM的方法。
该方法旨在充分利用两种传感器的优势,提高SLAM系统的精度和鲁棒性。
1. 引言SLAM技术是无人系统、自主导航和增强现实等领域的核心技术之一。
传统的SLAM方法通常使用单目相机或激光雷达进行环境建模和定位,但存在定位漂移和环境不完全重建等问题。
基于此,本文提出了一种使用异构传感器的协同SLAM方法。
2. 鱼眼相机和RGB-D相机的优势鱼眼相机具有广角视野和大视场深度,能够提供更加全面的环境信息。
它能够捕捉到更多的特征点,减少图像模糊和运动失真。
RGB-D相机通过红外光和深度传感器可以获得相对精确的三维点云数据,使得环境重建更加准确。
3. 异构传感器的数据融合本文提出了一种将鱼眼相机和RGB-D相机的数据进行融合的方法。
首先,通过特征点匹配和鲁棒的图像配准方法将两种相机的图像对齐。
然后,利用双目视觉几何学方法将鱼眼相机的图像转化为等效的透视投影图像,与RGB-D相机的深度图像进行配准。
最后,利用数据融合算法将两种相机的信息进行融合,得到更加准确和完整的环境地图。
4. SLAM系统建模和优化在异构协同SLAM系统中,需要建立一个能够同时描述相机位姿和环境地图的模型。
本文采用基于特征的方法,提取鱼眼相机和RGB-D相机的特征点,并通过三角化得到三维点云。
然后,使用非线性优化算法对位姿和地图进行迭代优化,使得SLAM系统能够更准确地定位和建模。
5. 实验结果与分析本文使用了自主车辆进行了一系列的实验。
结果表明,相比单独使用鱼眼相机或RGB-D相机,异构协同SLAM方法能够显著提高定位精度和环境地图的准确性。
同时,该方法对于光线变化、遮挡等场景具有更强的鲁棒性。
基于RGB-D相机的SLAM关键技术研究基于RGB-D相机的SLAM关键技术研究摘要:随着3D传感技术的快速发展,RGB-D相机在即时建图和定位中发挥了重要作用。
本文旨在研究基于RGB-D相机的实时定位与建图(SLAM)技术,并介绍其中的关键技术,包括特征提取与描述、图像匹配与配准、地图构建与更新以及位姿估计与优化等方面。
在实验中,我们采用RGB-D相机(如Microsoft Kinect),通过对传感器数据的处理和分析,实现对室内环境的快速建立和精确定位。
实验结果表明,基于RGB-D相机的SLAM技术能够有效地进行环境感知和位姿估计,并有望应用于室内导航、机器人导航、增强现实等领域。
关键词:RGB-D相机;实时定位与建图;特征提取与描述;图像匹配与配准;地图构建与更新;位姿估计;优化一、引言同时进行实时建图与定位是许多机器人和计算机视觉应用的关键问题。
此前,主要基于激光雷达和摄像机等传感器进行建图和定位。
然而,随着RGB-D相机技术的出现,它不仅可以提供像素级的彩色图像,还可通过深度信息获取物体的三维空间坐标。
这使得RGB-D相机成为了一种理想的传感器用于实时定位与建图(SLAM)任务。
二、特征提取与描述在SLAM任务中,特征提取与描述是一个十分重要的步骤。
首先,通过RGB图像提取出特征点,并计算出特征描述子。
同时,还需通过深度图像提取深度信息,并与特征点进行匹配。
常用的特征点提取算法有Harris角点检测、FAST角点检测和SIFT算法等。
对于特征描述子的计算,常用的方法有SIFT、SURF和ORB等。
特征的质量和数量对后续的图像匹配和位姿估计有很大影响,因此需要选择合适的特征提取和描述方法。
三、图像匹配与配准图像匹配是SLAM任务中的核心问题之一。
通常,通过计算特征匹配的一致性来确定两幅图像之间的相对位姿关系。
匹配的难点在于对特征点进行有效的筛选,并进行准确的匹配。
在RGB-D相机中,可以利用深度图像来辅助特征点的匹配,提高匹配的准确性和鲁棒性。
视觉SLAM的分类引言随着计算机视觉和机器人技术的发展,视觉SLAM(Simultaneous Localization and Mapping,即时定位与建图)作为一种重要的感知和导航技术,被广泛应用于自主导航、增强现实、机器人导航等领域。
视觉SLAM通过从视觉传感器获取图像信息,并将其与运动估计算法相结合,实现同时定位机器人的位置和构建环境地图。
在这篇文章中,我们将对视觉SLAM的分类进行全面、详细、完整且深入地探讨。
单目视觉SLAM概述单目视觉SLAM是指仅通过单个摄像头获取的图像信息来实现同时定位和建图的技术。
相对于使用多个传感器的多传感器SLAM来说,单目视觉SLAM更加具有挑战性,因为单个视角往往无法提供足够的几何信息来进行定位和建图。
方法•特征点法:基于特征点的方法是最常用的单目视觉SLAM方法之一。
通常通过提取图像中的关键点,并使用特征描述子来进行特征匹配和跟踪。
同时,该方法也会估计摄像头的运动和三维场景点的位置,以实现定位和建图。
•直接法:直接法是另一种常用的单目视觉SLAM方法。
该方法通过将图像像素值直接用于估计摄像头的运动和场景的深度信息。
与特征点法相比,直接法能够获得更多的几何信息,但该方法对光照变化和纹理稀疏场景比较敏感。
应用•自主导航:单目视觉SLAM可以用于机器人的自主导航。
通过结合图像信息和运动估计,机器人可以实时地感知自身位置和周围环境,从而进行路径规划和避障。
•增强现实:单目视觉SLAM也可以应用于增强现实。
通过追踪相机的运动以及对场景中物体的建模,可以将虚拟对象与真实世界进行融合,使用户能够在现实世界中与虚拟对象进行交互。
双目视觉SLAM概述双目视觉SLAM是指基于双目(左右)摄像头获取的图像信息来实现同时定位和建图的技术。
相对于单目视觉SLAM来说,双目视觉SLAM可以通过摄像头之间的视差来获得更多的三维信息,从而提高定位和建图的精度。
方法•立体匹配法:双目视觉SLAM中最常用的方法是立体匹配法。
slam本科毕设题目
SLAM(Simultaneous Localization and Mapping)是一个复杂的研究领域,涉及机器人技术、计算机视觉和传感器融合等多个学科。
因此,对于本科生来说,完成一个完整的SLAM项目作为毕业设计题目是一个很大的挑战。
不过,我可以为你提供一些可能的题目和思路,供你参考:
1. 基于RGB-D相机的SLAM系统实现
在这个题目中,你可以使用微软的Kinect或Intel的RealSense等RGB-D相机作为传感器,通过实现一个SLAM系统来处理3D场景中的定位和地图构建问题。
你可以选择使用开源的SLAM框架,如ORB-SLAM或LOAM等,并根据需要进行修改和优化。
2. 基于激光雷达的SLAM系统实现
激光雷达是一种常用的传感器,可以用于实现精确的SLAM系统。
在这个题目中,你可以选择使用开源的激光雷达数据集,如KITTI或Velodyne HDL32E等,并实现一个SLAM系统来处理激光雷达数据。
你可以选择使用开源的SLAM框架,如Cartographer或LeGO-LOAM 等,并根据需要进行修改和优化。
3. 基于IMU和轮速传感器的SLAM系统实现
在这个题目中,你可以使用IMU(Inertial Measurement Unit)和轮速传感器来获取机器人的运动信息,并实现一个SLAM系统来处理机器人在动态环境中的定位和地图构建问题。
你可以选择使用开源的
SLAM框架,如Cartographer或OKVIS等,并根据需要进行修改和优化。
基于前后端图优化的RGB-D三维SLAM邢科新;竺海光;林叶贵;张雪波【摘要】针对传统滤波方法在解决移动机器人同时定位与地图构建(SLAM)中存在的累积误差问题,将图优化方法应用于前端和后端优化中,以提高移动机器人位姿估计和建图的准确性.运用O RB算法进行图像的特征提取与匹配,将图优化的方法应用到PnP问题的求解中,实现了机器人位姿的准确估计.基于词典(Bag of words)的闭环检测算法来进行闭环检测,得到存在的大回环,同时利用相邻几帧的匹配关系实时检测邻近几帧之间可能存在的局部回环.用图优化的方法对这些回环进行优化,得到准确的运动轨迹和点云地图.实验结果表明:基于前后端图优化的RGB-D三维SLAM算法,在室内环境下具有良好的精度和实时性.【期刊名称】《浙江工业大学学报》【年(卷),期】2018(046)006【总页数】6页(P616-621)【关键词】图优化;三维SLAM;PnP;视觉词典;回环检测【作者】邢科新;竺海光;林叶贵;张雪波【作者单位】浙江工业大学信息工程学院,浙江杭州 310023;浙江工业大学信息工程学院,浙江杭州 310023;浙江工业大学信息工程学院,浙江杭州 310023;南开大学机器人与信息自动化研究所,天津 300071【正文语种】中文【中图分类】TP242针对处在复杂环境中的机器人,利用自身所携带的视觉传感器获取机器人所在环境的三维空间模型和机器人的运动轨迹,这是视觉SLAM(Simultaneous localization and mapping,即时定位与地图构建)所要完成的工作,也是实现移动机器人任务规划、导航和控制等自主运动的前提之一[1]。
近几年,流行的深度摄像机不仅可以获得环境的二维图像信息,还可以准确得到对应环境的深度信息。
因此,利用深度摄像机来做视觉SLAM成为研究的热点。
现行的RGB-D SLAM算法主要由前端和后端两部分组成[2]。
前端部分利用得到的彩色图和深度图计算提取各帧间的空间位置关系,而后端部分对所得到的这些移动机器人位姿进行优化,来减少其中存在的非线性误差。
度图像。
如图1和图2所示。
图1RGB-D数据1图2RGB-D数据2
图3特征点匹配
使用ORB特征提取与匹配算法对图1和2的图像进行特征点的提取和匹配,匹配之后的结果如图3所示。
通过前述的实验结果,可以计算出两张图像间的运动关系。
将提取出的图像特征点的二维像素坐标转云坐标,并采用相机内参参数
Opencv中的SolvePnPRansac函数
动图,如图6所示。
图4未经回环检测的点云地图
图5经回环检测的点云地图图6运动轨迹
5总结
本文采用标准开源测试数据集nyuv2并对文中提出的一种基于RGB-D SLAM算法进行了一系列的实验验证:基于ORB算法的图像特征点提取与匹配、估计图像间的运动关系、生成点云地图与图优化轨迹。
并在生成点云地图部分,将未引入回环检测环节与引入回环检测环节生成的点云地图进行了对比分析。
结果表明,本文的研究方法具有可行性。
【参考文献】
[1]李海洋,李洪波,林颖,等.基于Kinect的SLAM方法[J],中南大学学报:自然科学版,2013(S2).
[2]贾松敏,王可,郭兵,等.基于RGB-D相机的移动机器人三维SLAM[J].华中科技大学学报:自然科学版,2014(I):103-109.。
RGB - D斯拉姆数据集和基准(RGB-D SLAM Datasetand Benchmark)数据介绍:We provide a large dataset containing RGB-D data and ground-truth data with the goal to establish a novel benchmark for the evaluation of visual odometry and visual SLAM systems. Our dataset contains the color and depth images of a Microsoft Kinect sensor along theground-truth trajectory of the sensor. The data was recorded at full frame rate (30 Hz) and sensor resolution (640×480). The ground-truth trajectory was obtained from a high-accuracy motion-capture system with eight high-speed tracking cameras (100 Hz). Further, we provide the accelerometer data from the Kinect. Finally, we propose an evaluation criterion for measuring the quality of the estimated camera trajectory of visual SLAM systems.关键词:RGB-D,地面实况,基准,测程,轨迹,RGB-D,ground-truth,benchmark,odometry,trajectory,数据格式:IMAGE数据详细介绍:RGB-D SLAM Dataset and BenchmarkContact: Jürgen SturmWe provide a large dataset containing RGB-D data and ground-truth data with the goal to establish a novel benchmark for the evaluation of visual odometry and visual SLAM systems. Our dataset contains the color and depth images of a Microsoft Kinect sensor along the ground-truth trajectory of the sensor. The data was recorded at full frame rate (30 Hz) and sensor resolution (640×480). The ground-truth trajectory was obtained from a high-accuracy motion-capture system with eight high-speed tracking cameras (100 Hz). Further, we provide the accelerometer data from the Kinect. Finally, we propose an evaluation criterion for measuring the quality of the estimated camera trajectory of visual SLAM systems.How can I use the RGB-D Benchmark to evaluate my SLAM system?1. Download one or more of the RGB-D benchmark sequences (fileformats, useful tools)2. Run your favorite visual odometry/visual SLAM algorithm (for example,RGB-D SLAM)3. Save the estimated camera trajectory to a file (file formats, exampletrajectory)4. Evaluate your algorithm by comparing the estimated trajectory with theground truth trajectory. We provide an automated evaluation tool to help you with the evaluation. There is also an online version of the tool. Further remarksJose Luis Blanco has added our dataset to the mobile robot programming toolkit (MRPT) repository. The dataset (including example code and tools) can be downloaded here.∙If you have any questions about the dataset/benchmark/evaluation/file formats, please don't hesitate to contact Jürgen Sturm.∙We are happy to share our data with other researchers. Please refer to the respective publication when using this data.Related publications2011Conference and Workshop PapersReal-Time Visual Odometry from Dense RGB-D Images (F. Steinbruecker, J. Sturm, D. Cremers), In Workshop on Live Dense Reconstruction with Moving Cameras at the Intl. Conf. on Computer Vision (ICCV), 2011. [bib] [pdf] Towards a benchmark for RGB-D SLAM evaluation (J. Sturm, S. Magnenat, N. Engelhard, F. Pomerleau, F. Colas, W. Burgard, D. Cremers, R. Siegwart), In Proc. of the RGB-D Workshop on Advanced Reasoning with Depth Cameras at Robotics: Science and Systems Conf. (RSS), 2011. [bib] [pdf] [pdf]Real-time 3D visual SLAM with a hand-held camera (N. Engelhard, F. Endres, J. Hess, J. Sturm, W. Burgard), In Proc. of the RGB-D Workshop on 3D Perception in Robotics at the European Robotics Forum, 2011. [bib] [pdf] [video] [video] [video]File FormatsWe provide the RGB-D datasets from the Kinect in the following format:Color images and depth mapsWe provide the time-stamped color and depth images as a gzipped tar file (TGZ).∙The color images are stored as 640×480 8-bit RGB images in PNG format.∙The depth maps are stored as 640×480 16-bit monochrome images in PNG format.∙The color and depth images are already pre-registered using the OpenNI driver from PrimeSense, i.e., the pixels in the color and depthimages correspond already 1:1.∙The depth images are scaled by a factor of 5000, i.e., a pixel value of 5000 in the depth image corresponds to a distance of 1 meter from thecamera, 10000 to 2 meter distance, etc. A pixel value of 0 meansmissing value/no data.Ground-truth trajectoriesWe provide the groundtruth trajectory as a text file containing the translation and orientation of the camera in a fixed coordinate frame. Note that also our automatic evaluation tool expects both the groundtruth and estimated trajectory to be in this format.∙Each line in the text file contains a single pose.∙The format of each line is 'timestamp tx ty tz qx qy qz qw'∙timestamp (float) gives the number of seconds since the Unix epoch.∙tx ty tz (3 floats) give the position of the optical center of the color camera with respect to the world origin as defined by the motion capture system.∙qx qy qz qw (4 floats) give the orientation of the optical center of the color camera in form of a unit quaternion with respect to the world origin as defined by the motion capture system.∙The file may contain comments that have to start with ”#”.Intrinsic Camera Calibration of the KinectThe Kinect has a factory calibration stored onboard, based on a high level polynomial warping function. The OpenNI driver uses this calibration for undistorting the images, and for registering the depth images (taken by the IR camera) to the RGB images. Therefore, the depth images in our datasets are reprojected into the frame of the color camera, which means that there is a 1:1 correspondence between pixels in the depth map and the color image.The conversion from the 2D images to 3D point clouds works as follows. Note that the focal lengths (fx/fy), the optical center (cx/cy), the distortion parameters (d0-d4) and the depth correction factor are different for each camera. The Python code below illustrates how the 3D point can be computed from the pixel coordinates and the depth value:fx = 525.0 # focal length xfy = 525.0 # focal length ycx = 319.5 # optical center xcy = 239.5 # optical center yds = 1.0 # depth scalingfactor = 5000 # for the 16-bit PNG files# OR: factor = 1 # for the 32-bit float images in the ROS bag filesfor v in range(depth_image.height):for u in range(depth_image.width):Z = (depth_image[v,u] / factor) * ds;X = (u - cx) * Z / fx;Y = (v - cy) * Z / fy;Note that the above script uses the default (uncalibrated) intrinsic parameters. The intrinsic parameters for the Kinects used in the fr1 and fr2 dataset are as follows:Calibration of the color cameraWe computed the intrinsic parameters of the RGB camera from thergbd_dataset_freiburg1/2_rgb_calibration.bag.Camera fx fy cx cy d0 d1 d2 d3 d4(ROS525.0 525.0 319.5 239.5 0.0 0.0 0.0 0.0 0.0 default)Freiburg 1517.3 516.5 318.6 255.3 0.2624 -0.9531 -0.0054 0.0026 1.1633 RGBFreiburg 2520.9 521.0 325.1 249.7 0.2312 -0.7849 -0.0033 -0.0001 0.9172 RGBCalibration of the depth imagesWe verified the depth values by comparing the reported depth values to the depth estimated from the RGB checkerboard. In this experiment, we found that the reported depth values from the Kinect were off by a constant scaling factor, as given in the following table:Camera dsFreiburg 1 Depth 1.035Freiburg 2 Depth 1.031Calibration of the infrared cameraWe also provide the intrinsic parameters for the infraredcamera. Note that the depth images provided in our dataset are alreadypre-registered to the RGB images. Therefore, rectifying the depth images based on the intrinsic parameters is not straight forward.Camera fx fy cx cy d0 d1 d2 d3 d4 Freiburg 1 IR591.1 590.1 331.0 234.0 -0.0410 0.3286 0.0087 0.0051 -0.5643Freiburg 2 IR580.8 581.8 308.8 253.0 -0.2297 1.4766 0.0005 -0.0075 -3.4194 Movies for visual inspectionFor visual inspection of the individual datasets, we also provide movies of the Kinect (RGB and depth) and of an external camcorder. The movie format is mpeg4 stored in an AVI container.Alternate file formatsROS bagFor people using ROS, we also provide ROS bag files that contain the color images, monochrome images, depth images, camera infos, point clouds and transforms – including the groundtruth transformation from the /world frame all in a single file. The bag files (ROS diamondback) contain the following message topics:∙/camera/depth/camera_info (sensor_msgs/CameraInfo) contains the intrinsic camera parameters for the depth/infrared camera, asreported by the OpenNI driver∙/camera/depth/image (sensor_msgs/Image) contains the depth map ∙/camera/rgb/camera_info (sensor_msgs/CameraInfo) contains the intrinsic camera parameters for the RGB camera, as reported by theOpenNI driver∙/camera/rgb/image_color (sensor_msgs/Image) contains the color image from the RGB camera∙/imu (sensor_msgs/Imu), contains the accelerometer data from the Kinect∙/tf (tf/tfMessage), contains:o the ground-truth data from the mocap (/world to /Kinect)o the calibration betwenn mocap and the optical center of the Kinect's color camera (/Kinect to /openni_camera),o and the ROS-specific, internal transformations (/openni_camera to /openni_rgb_frame to /openni_rgb_optical_frame).If you need the point clouds and monochrome images, you can use the adding_point_clouds_to_ros_bag_files script to add them:∙/camera/rgb/image_mono (sensor_msgs/Image) contains the monochrome image from the RGB camera∙/camera/rgb/points (sensor_msgs/PointCloud2) contains the colored point clouds/camera/depth/points (sensor_msgs/PointCloud2) contains the point cloudMobile Robot Programming Toolkit (MRPT)Jose Luis Blanco has added our dataset to the mobile robot programming toolkit (MRPT) repository. The dataset (including example code and tools) can be downloaded hereUseful tools for the RGB-D benchmarkWe provide a set of tools that can be used to pre-process the datasets and to evaluate the SLAM/tracking results. The scripts can be downloaded here.To checkout the repository using subversion, runsvn checkouthttps://svncvpr.in.tum.de/cvpr-ros-pkg/trunk/rgbd_benchmark/rgbd_benchmar k_toolsAssociating color and depth imagesThe Kinect provides the color and depth images in an un-synchronized way. This means that the set of time stamps from the color images do not intersect with those of the depth images. Therefore, we need some way of associating color images to depth images.For this purpose, you can use the ''associate.py'' script. It reads the time stamps from the rgb.txt file and the depth.txt file, and joins them by finding the best matches.usage: associate.py [-h] [--first_only] [--offset OFFSET][--max_difference MAX_DIFFERENCE]first_file second_fileThis script takes two data files with timestamps and associates them positional arguments:first_file first text file (format: timestamp data)second_file second text file (format: timestamp data)optional arguments:-h, --help show this help message and exit--first_only only output associated lines from first file--offset OFFSET time offset added to the timestamps of the second file(default: 0.0)--max_difference MAX_DIFFERENCEmaximally allowed time difference for matching entries(default: 0.02)EvaluationAfter estimating the camera trajectory of the Kinect and saving it to a file, we need to evaluate the error in the estimated trajectory by comparing it with the ground-truth. There are different error metrics. Two prominent methods is the absolute trajectory error (ATE) and the relative pose error (RPE). The ATE is well-suited for measuring the performance of visual SLAM systems. In contrast, the RPE is well-suited for measuring the drift of a visual odometry system, for example the drift per second.For both metrics, we provide automated evaluation scripts that can be downloaded here. Note that there is also an online version available on our website. Both trajectories have to be stored in a text file (format: 'timestamp tx ty tz qx qy qz qw', more information). For comparison, we offer a set of trajectories from RGBD-SLAM.Absolute Trajectory Error (ATE)The absolute trajectory error directly measures the difference between points of the true and the estimated trajectory. As a pre-processing step, we associate the estimated poses with ground truth poses using the timestamps. Based on this association, we align the true and the estimated trajectory using singular value decomposition. Finally, we compute the difference between each pair of poses, and output the mean/median/standard deviation of these differences. Optionally, the script can plot both trajectories to a png or pdf file. 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_fileThis script computes the absolute trajectory error from the ground truthtrajectory and the estimated trajectory.positional arguments:first_file first text file (format: timestamp tx ty tz qx qy qzqw)second_file second text file (format: timestamp tx ty tz qx qy qzqw)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_DIFFERENCEmaximally allowed time difference for matching entries(default: 0.02)--save SAVE save aligned second trajectory to disk (format: stamp2x2 y2 z2)--save_associations SAVE_ASSOCIATIONSsave associated first and aligned second trajectory todisk (format: stamp1 x1 y1 z1 stamp2 x2 y2 z2)--plot PLOT plot the first and the aligned second trajectory to animage (format: png)--verbose print all evaluation data (otherwise, only the RMSEabsolute translational error in meters after alignmentwill be printed)Relative Pose Error (RPE)For computing the relative pose error, we provide a script ''evaluate_rpe.py''. This script computes the error in the relative motion between pairs of timestamps. By default, the script computes the error between all pairs of timestamps in the estimated trajectory file. As the number of timestamp pairs in the estimated trajectory is quadratic in the length of the trajectory, it can make sense to downsample this set to a fixed number (–max_pairs). Alternatively, one can choose to use a fixed window size (–fixed_delta). In this case, each pose in the estimated trajectory is associated with a later pose according to the window size (–delta) and unit (–delta_unit). This evaluation technique is useful for estimating the drift.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_fileThis 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 tytz qx qy qz qw")estimated_file estimated trajectory file (format: "timestamp tx ty tzqx qy qz qw")optional arguments:-h, --help show this help message and exit--max_pairs MAX_PAIRSmaximum number of pose comparisons (default: 10000,set to zero to disable downsampling)--fixed_delta only consider pose pairs that have a distance of deltadelta_unit (e.g., for evaluating the drift persecond/meter/radian)--delta DELTA delta for evaluation (default: 1.0)--delta_unit DELTA_UNITunit of delta (options: 's' for seconds, 'm' formeters, 'rad' for radians, 'f' for frames; default:'s')--offset OFFSET time offset between ground-truth and estimatedtrajectory (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_gt0stamp_gt1trans_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 meantranslational error measured in meters will beprinted)Generating a point cloud from imagesThe depth images are already registered to the color images, so the pixels in the depth image already correspond one-to-one to the pixels in the color image. Therefore, generating colored point clouds is straight-forward. An example script is available in ''generate_pointcloud.py'', that takes a color image and a depth map as input, and generates a point cloud file in the PLY format. This format can be read by many 3D modelling programs, for example meshlab. You can download meshlab for Windows, Mac and Linux.usage: generate_pointcloud.py [-h] rgb_file depth_file ply_fileThis script reads a registered pair of color and depth images and generates a colored 3D point cloud in the PLY format.positional arguments:rgb_file input color image (format:png)depth_file input depth image (format: png)ply_file output PLY file (format: ply)optional arguments:-h, --help show this help message and exitAdding point clouds to ROS bag filesOn the download page, we already provide ROS bag files with added point clouds for the datasets for visual inspection in RVIZ. Because of the large size of the resulting files, we downsampled these bag files to 2 Hz. In case that you want to generate ROS bag files that contain the point clouds for all images (at 30 Hz), you can use the ''add_pointclouds_to_bagfile.py'' script.usage: add_pointclouds_to_bagfile.py [-h] [--start START][--duration DURATION] [--nth NTH][--skip SKIP] [--compress]inputbag [outputbag]This scripts reads a bag file containing RGBD data, adds the corresponding PointCloud2 messages, and saves it again into a bag file. Optional argumentsallow to select only a portion of the original bag file.positional arguments:inputbag input bag fileoutputbag output bag fileoptional arguments:-h, --help show this help message and exit--start START skip the first N seconds of input bag file (default:0.0)--duration DURATION only process N seconds of input bag file (default: off)--nth NTH only process every N-th frame of input bag file(default: 15)--skip SKIP skip N blocks in the beginning (default: 1)--compress compress output bag fileVisualizing the datasets in RVIZRVIZ is the standard visualization tool in ROS. It can be easily adapted to display many different messages. In particular, it can be used to display the point clouds from a ROS bag file. For this, run (in three different consoles) roscorerosrun rviz rvizrosbag play rgbd_dataset_freiburg1_xyz-2hz-with-pointclouds.bagIf this is the first launch, you will have to enable the built-in displays (Menu –> Plugins –> Check “Loaded” for the builtin plugins). In the displays tab, set the “fixed frame” to ”/world”. Click on “Add”, and select the PointCloud2 display, and set topic to ”/camera/rgb/points”. To show the colors, change “color transformer” to “RGB8” in the point cloud display and the “style”to “points”. If you want, you can set the decay time to a suitable value, for example 5 seconds, to accumulate the points in the viewer as they come in. The result should then look as follows:数据预览:点此下载完整数据集。