필터 지우기
필터 지우기

PCREAD: Not all points defined in the header could be loaded.

조회 수: 5 (최근 30일)
Sushmitha Kudari
Sushmitha Kudari 2020년 2월 22일
댓글: Sushmitha Kudari 2020년 2월 22일
I have the following function to export data into .ply format. However when I use
ptCloud = pcread('OutputFile.ply')
it looks like all the properties of ptCloud is empty.
Data File: Data File
Code to Export as .ply:
function write_ply(fname, P) %C
% Input: fname: output file name, e.g. 'data.ply'
% P: 3*m matrix with the rows indicating X, Y, Z
% C: 3*m matrix with the rows indicating R, G, B
num = size(P, 2);
header = 'ply\n';
header = [header, 'format ascii 1.0\n'];
header = [header, 'comment written by Sush\n'];
header = [header, 'element vertex ', num2str(num), '\n'];
header = [header, 'property float32 x\n'];
header = [header, 'property float32 y\n'];
header = [header, 'property float32 z\n'];
header = [header, 'property uchar red\n'];
header = [header, 'property uchar green\n'];
header = [header, 'property uchar blue\n'];
header = [header, 'end_header\n'];
data = [P'];
%, double(C')];
fid = fopen(fname, 'w');
fprintf(fid, header);
dlmwrite(fname, data, '-append', 'delimiter', '\t', 'precision', 3);
fclose(fid);
  댓글 수: 1
Sushmitha Kudari
Sushmitha Kudari 2020년 2월 22일
Found the issue: if you are not passing in a color matrix, you should not include the color properties in the header.

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

답변 (0개)

카테고리

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