Unable to read pcd files using pcdread in matlab 2016a

12 次查看(过去 30 天)
I get following error when I try to read pcd file using pcread (My system is matlab2016a, ubuntu 16.04, 64bit):
a=pcread('test.pcd');
Error using visionPlyRead
Ply file parsing error: Unable to read 'ply' from header.
Error in pcread (line 47)
properties = visionPlyRead(filename,elementName,requiredProperties,optionalProperties);
The pcd file is 0.7 format and has "COUNT" set to 1. The header of the pcd file is as below:
# .PCD v.7 - Point Cloud Data file format
VERSION .7
FIELDS x y z rgb
SIZE 4 4 4 4
TYPE F F F F
COUNT 1
WIDTH 213
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 213
DATA ascii
I have also tried clouds without RGB. The header is:
# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z
SIZE 4 4 4
TYPE F F F
COUNT 1(changed from 1 1 1)
WIDTH 12007
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 12007
DATA ascii
I got errors in both cases. The files dont have any "nan" values
  2 个评论
Jan
Jan 2018-5-18
编辑:Jan 2018-5-18
The message "Ply file parsing error: Unable to read 'ply' from header" is not useful. Can you attach the input file?

请先登录,再进行评论。

回答(1 个)

guojia guo
guojia guo 2021-4-14
Well,it seems because of the low version of MATLAB,change it to 2018,pcread() can read both .pcd file and ply file.Another solution is using this function in MATLAB COMMUNITY,read .pcd file then using pointCloud() to make it .
pt=loadpcd('1.pcd');
ptCloud=pointCloud(pt');
pcwrite(ptCloud,'1.ply');%格式的转换

类别

Help CenterFile Exchange 中查找有关 Point Cloud Processing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by