用的matlab,可以用来显示文件夹下的所有ply点云。
path=strcat('E:\WorkDatas\argoverse-tracking\train1\dcdcd8b3-0ba1-3218-b2ea-7bb965aad3f0\lidar\'); %当前所在目录
file = dir(fullfile(path,'*.ply')); %读取所有ply格式文件
filenames = {file.name}';
close all;
figure('units','normalized','outerposition',[0 0 1 1]);
for idx = 1 : filelength %批处理
filedir = strcat(path, filenames(idx));
ptCloud=pcread(filedir{1}); %ply格式文件用pcread读取
ptCX = ptCloud.Location(:,1);
ptCY = ptCloud.Location(:,2);
ptCZ = ptCloud.Location(:,3);
c = ptCZ;%c表示对z轴进行着色
scatter3(ptCX, ptCY, ptCZ,10,c,'.')
xlim([-200 200]);%限制坐标轴范围
ylim([-200 200]);
zlim([0 100]);
view([1,1,1]);
pause(0.1)%调整两帧间延迟时间
end