KITTI数据集测试 - 2 groundtruth 真实地图

在poses目录下,包含00.txt-10.txt 11个序列,每一个文件包换Nx12个表格,N代表帧数。每一行利用3x4转移矩阵代表左边相机系统位姿,转移矩阵将当前帧左边相机系统中的一个点映射到第0帧的坐标系统中。转移矩阵中平移的部分表示当前相机位置(相对于第0帧)。

Groundtruth

sequence 00的地面地图如下图所示:
KITTI数据集测试 - 2 groundtruth 真实地图_第1张图片

代码

下面代码为MATLAB中显示上图sequence 00的groundtruth,修改filename可以获得所有sequence的groundtruth地图。

%% display groundtruth of KITTI poses
% include sequence from 00-10.txt

% read from poses
filename = '$PATH/poses/00.txt';
fid = fopen(filename);
fseek(fid, 0, 'bof');
lastposition = ftell(fid);
disp(['start position:',num2str(lastposition)]);

groundtruth = [];

while fgetl(fid) ~= -1, % end of line check

    fseek(fid, lastposition, 'bof');
    line = textscan(fid,'%f %f %f %f %f %f %f %f %f %f %f %f\n',1);
    line = [line{:}];
    transform = vec2mat(line,4);

    groundtruth = [groundtruth; [transform(1,4), transform(3,4)]];
    lastposition = ftell(fid);
    disp(['lastposition:',num2str(lastposition)]);

end

% display ground truth
scatter(groundtruth(:,1),groundtruth(:,2));

fclose(fid);

你可能感兴趣的:(Autonomous,Mobile,Robots,自主移动机器人,(Autonomous,Mobile,Robots))