点云数据文件常用格式
文件类型汇总
OFF - Object File Format
PLY - Polygon File Format also known as the Stanford Triangle Format
PTS - Laser scan data format
文件详细格式
1. OFF - Object File Format
OFF numVertices numFaces numEdges
x y z
x y z
... numVertices like above
NVertices v1 v2 v3 ... vN
MVertices v1 v2 v3 ... vM
... numFaces like above
立方体使用 OFF 格式描述的例子:
OFF
8 6 0
-0.500000 -0.500000 0.500000
0.500000 -0.500000 0.500000
-0.500000 0.500000 0.500000
0.500000 0.500000 0.500000
-0.500000 0.500000 -0.500000
0.500000 0.500000 -0.500000
-0.500000 -0.500000 -0.500000
0.500000 -0.500000 -0.500000
4 0 1 3 2
4 2 3 5 4
4 4 5 7 6
4 6 7 1 0
4 1 7 5 3
4 6 0 2 4
2. PLY - Polygon File Format also known as the Stanford Triangle Format
ply
format ascii 1.0 { ascii/binary, format version number }
comment made by Greg Turk { comments keyword specified, like all lines }
comment this file is a cube
element vertex 8 { define "vertex" element, 8 of them in file }
property float x { vertex contains float "x" coordinate }
property float y { y coordinate is also a vertex property }
property float z { z coordinate, too }
element face 6 { there are 6 "face" elements in the file }
property list uchar int vertex_index { "vertex_indices" is a list of ints }
end_header { delimits the end of the header }
0 0 0 { start of vertex list }
0 0 1
0 1 1
0 1 0
1 0 0
1 0 1
1 1 1
1 1 0
4 0 1 2 3 { start of face list }
4 7 6 5 4
4 0 4 5 1
4 1 5 6 2
4 2 6 7 3
4 3 7 4 0
3. PTS - Laser scan data format
253730194
-0.41025 -2.0806 8.00981 55 52 44 65
-0.63016 -1.84527 6.59447 228 228 230 225
-0.4766 -2.14446 7.91288 60 56 54 68
-0.52017 -1.51698 7.91458 60 58 50 71
: : :
: : :
: : :
PTS 文件无法用 MeshLab 直接打开,而 PLY 文件可以,所以可以手动将 PTS 文件转换为 PLY 文件,便可以在 MeshLab 中查看。转换方式:在 PTS 文件头加上:
ply
format ascii 1.0
element vertex [pts_file_vertex_num]
property float x
property float y
property float z
end_header
References
原文:https://www.cnblogs.com/crayonsea/p/12819823.html