Error using dlmread- mismatch between file and format character vector (reading a ply file)
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kaela Johnson
le 3 Juin 2019
Réponse apportée : Walter Roberson
le 4 Juin 2019
I am trying to read in a ply file to matlab using the following code:
function fv = read_ply2_ExampleData(fileName)
% this function reads a ply file (must be in text format)
% to calc. normals etc use calcMeshNormals
% Copyright : This code is written by Ajmal Saeed Mian {ajmal@csse.uwa.edu.au}
% Computer Science, The University of Western Australia. The code
% may be used, modified and distributed for research purposes with
% acknowledgement of the author and inclusion this copyright information.
% Modified by Vipin Vijayan.
x = dlmread(fileName, ' ', [4 2 4 2]);
y = dlmread(fileName, ' ', [15 2 15 2]);
header = 18; %starting by row=0, the first row of data to be read starts here
vertex = dlmread(fileName, ' ', [header 0 x+(header-1) 9]);
poly = dlmread(fileName, ' ', [x+header 0 x+(header-1)+y 3]);
poly(:,1) = [];
poly = poly + 1;
fv.vertices = vertex;
fv.faces = poly;
I obtain the following error:
Error using dlmread
Mismatch between file and format character vector. Trouble reading 'Numeric' field from file (row number 1, field number 3) ==> by CloudCompare!\n
I have been able to read in other ply files using this code, I am not sure what I am missing this time. The ply file is a large point cloud ( about 6 000 000 points) that I converted to a ply file using CloudCompare.
0 commentaires
Réponse acceptée
Walter Roberson
le 4 Juin 2019
Your ply file contains a comment in an unexpected place. If you look at the file in the place it contains "by CloudCompare" a number is expected. Possibly the code is expecting that the line ends at that point and that the next line starts with a number
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Other Formats dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!