필터 지우기
필터 지우기

Unable to read pcd files using pcdread in matlab 2016a

조회 수: 12 (최근 30일)
shome
shome 2018년 5월 17일
답변: guojia guo 2021년 4월 14일
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?
Bin Qi
Bin Qi 2021년 1월 26일
I have the same issue. Have you figured out the fix?

댓글을 달려면 로그인하십시오.

답변 (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