17

Is there an official specification for the XYZ format for point clouds?

I've been searching all over and I didn't find it. I've seen that there are some files which line contains:

  • points coordinates, (X Y Z for each point )

  • others contain coordinates plus colors, (X Y Z R G B for each point )

  • there are even others that have an "Intensity" parameter.

I need to consider all the possibilities.

andrea.al
  • 175
  • 1
  • 2
  • 9
  • Consider to start from a file format (I think many file format exist, as there is no official "text file" format but every program have its format: doc, txt, odt..). For example, I worked with PLY format. In this file, different properties can be defined at the beginning of the file. It is your choice to have (or have not) a color or an intensity (or other things) associated to every XYZ point. Elements different from points (faces, edges) can also be defined, with their properties. – marcoresk Dec 21 '16 at 16:21

1 Answers1

11

No, there is not an official specification about the .xyz format for point clouds.

The .xyz format can be considered as part of a more general type of file formats: ASCII point cloud. You can consider members of this group many other extensions like: .asc,.txt,.pts

The problem is that because of that lack of specification the contents of the file may vary according to the creator.

The most logical thing would be that the first 3 columns always represent the X,Y,Z coordinates and the rest of the columns represent some scalar field associated to that point (Maybe R,G,B values, or Nx,Ny,Nz, etc)

If you want to consider all the possibilities you would need to take in account not only a variable number of columns but also the ASCII character used for separating each column and the possible existence of 1 or more "header" lines at the beggining of the file.

The best ASCII point cloud loader that I'm aware of is the included in CloudCompare.

Here is a screenshot of the dialog:

ASCII point cloud

And a link to the source code.

TarmoPikaro
  • 4,723
  • 2
  • 50
  • 62
David de la Iglesia
  • 2,436
  • 14
  • 29
  • Please also notice that in that code link valueIsBelow255 is used to detect where RGB values are. valueIsBelow255 check whether number is not float (does not contains dot) and it's value is between 0 and 255. – TarmoPikaro Aug 05 '21 at 13:35