필터 지우기
필터 지우기

pcd file written generated from matlab not being read by pcl

조회 수: 9 (최근 30일)
Shantnu Kakkar
Shantnu Kakkar 2018년 5월 11일
댓글: Yu-Hsiang Lai 2022년 10월 21일
Hi,
I generated a pcd file from matlab by doing pcwrite(cloud,'file.pcd'). However, when I am trying to read this file in PCL using pcl::io::loadPCDFile('file.pcd', cloud), the following error comes:
Failed to find match for field 'x'.
Failed to find match for field 'y'.
Failed to find match for field 'z'.
Has anyone encountered similar problem? Is there a work around?

답변 (2개)

Zohn Fang
Zohn Fang 2018년 5월 12일
Hi, I face the same problem. By default, MATLAB generates double-precision floating-numbers in the PCD file, whereas PCL can only process the PCD file of single-precision. Therefore, you can choose to result in single-precision PCD files by MATLAB or let the PCD file reader of PCL support the double-precision. I think the former is easier, and I chose it. Concretely, I use the "single()" command to change the matrix "ptCloud.Location" from double-precision to single-precision, and "pcwrite" the PCD file. In this case, the PCD file is saved as single-precision automatically, which is confirmed by a line in the PCD file--"SIZE 4 4 4". In this way, the single-precision PCD file can be read by PCL. BTW, My English is not well. If the description is not clear, please reply me. I hope this can help you.
  댓글 수: 1
Yu-Hsiang Lai
Yu-Hsiang Lai 2022년 10월 21일
Thank you for the solution. Finally found how to solve this problem.

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


Jeno Boka
Jeno Boka 2018년 11월 6일
편집: Jeno Boka 2018년 11월 6일
Note: ptCloud is a point cloud, read with MATLAB.
% create a Point Cloud, which is of single type
ptCloudSingle = pointCloud(single(ptCloud.Location),...
'Color',ptCloud.Color,...
'Normal',ptCloud.Normal,...
'Intensity',ptCloud.Intensity);
After pcwrite the written file can be parsed by PCL.
Based on Zohn Fang's answer

카테고리

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