您当前的位置: 首页 >  matlab

phymat.nico

暂无认证

  • 0浏览

    0关注

    1967博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Matlab点云ply文件的读入与写出

phymat.nico 发布时间:2020-03-29 11:37:18 ,浏览量:0

%% 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);


 

关注
打赏
1659628745
查看更多评论
立即登录/注册

微信扫码登录

0.0448s