フィルターのクリア

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 Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by