Why is pcread not reading the colour in a .PLY file?

6 Ansichten (letzte 30 Tage)
David Pritchard
David Pritchard am 10 Apr. 2017
Beantwortet: Charles Han am 29 Okt. 2019
I would like to import a densified point cloud I constructed in Pix4D into MATLAB. I had exported the point cloud from Pix4D as a .PLY file, ticking the option to save colours. When I uploaded my point cloud on sketchfab.com, thecolours were present, so the .PLY file clearly contains the colour information. But when I used pcread to read the point cloud into MATLAB, the resulting pointCloud object did not have any colour information, only x,y,z points.
I have tried to see if colour needs to be imported separately, but I cannot find out how to do this, and it would appear that colour should have been imported alongside the xyz points with pcread.
If anyone has any advice, I would be very thankful. Pix4D cannot save as .PCD so I need to use .PLY if possible.
Thanks!
  2 Kommentare
Nirav Sharda
Nirav Sharda am 17 Apr. 2017
Can you attach the .ply file? I tried to use 'pcread' on a file downloaded from http://www.kscan3d.com/gallery/ and it seem to work fine. It gives me the color information. The version of MATLAB I used was R2016a.
David Pritchard
David Pritchard am 2 Mai 2017
Bearbeitet: Walter Roberson am 2 Mai 2017
Hi Nirav, I am also using R2016a.
The zipped file is still more than 5MB, so I am afraid I cannot attach it here, but I have put the model on Sketchfab at this link: https://skfb.ly/6pKY6
You should be able to download the .ply file from there.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Pritchard
David Pritchard am 23 Mai 2017
A friend of mine has just found a solution to this, which I will add in case anyone else encounters this problem.
If I open the .PLY file from Pix4D in notepad the colours are called e.g. "property uchar diffuse_red", which different to what pcread is expecting.
By changing the colour names to e.g. "property uchar red" and saving the .PLY file, pcread was able to read the point cloud with correct colours.
  2 Kommentare
Raymond Phan
Raymond Phan am 7 Jun. 2018
Thanks for this. This was my problem as well. I was originally using diffuse_red and have removed it from my ply file. Thanks again!
Loki Scarlette
Loki Scarlette am 7 Aug. 2018
Thank you so much

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Charles Han
Charles Han am 29 Okt. 2019
Hi, i am on the same situation using pix4d export the .ply file and the head code of the file is binary_little_endian. But in my matlab program, the pcread cant read the binary file but it can read the ascii head file. I am wondering how you nake it.

Community Treasure Hunt

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

Start Hunting!

Translated by