%% read in
%1
tic
p1=dlmread('3D.txt');
toc %1.3s
%2
tic
p2=importdata('3D.txt');
toc %1.2s
%3 PLY file
tic
p3=pcread('p1_bi.ply');
toc %1.2s
%% write out
%1
tic
dlmwrite('p1.txt',p1);
toc %22s
%2
tic;fid = fopen('p2.txt','w');
for i=1:size(p1,1)
fprintf(fid,'%f %f %f \r\n',[p1(i,1),p1(i,2),p1(i,3)]);
end
fclose(fid);
toc %18s
%3 pcwrite PCD or PLY
ptCloud = pointCloud(p1);
tic
pcwrite(ptCloud,'p1_bi.ply','PLYFormat','binary');
toc %0.2s
tic
pcwrite(ptCloud,'p1_as.ply','PLYFormat','ascii');
toc %2s
%% show 3d point
figure;pcshow(ptCloud);
figure;pcshow(p1);
Matlab点云读入与写出
最新推荐文章于 2024-08-22 20:41:04 发布