文件類型匯總
- OFF - Object File Format
- PLY - Polygon File Format also known as the Stanford Triangle Format
- PTS - Laser scan data format
- PTX - ASCII based interchange format for point cloud data
- XYZ - Based on Cartesian coordinates
- LAS/LAZ - The most common format for exchanging points clouds
文件格式介紹
1. OFF - Object File Format
OFF 文件格式文檔 https://shape.cs.princeton.edu/benchmark/documentation/off_format.html
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 文件格式文檔 http://paulbourke.net/dataformats/ply/
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
PTS 文件格式文檔 http://paulbourke.net/dataformats/pts/
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
: : :
: : :
: : :
使用 MeshLab 打開 PTS 文件的方法 https://sourceforge.net/p/meshlab/discussion/499532/thread/6a658695/
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
4. PTX - ASCII based interchange format for point cloud data
PTX 文件格式參考文檔 https://sites.google.com/site/matterformscanner/learning-references/ptx-format
PTX 點雲文件頭部格式:
number of rows
number of columns
st1 st2 st3 ; scanner registered position
sx1 sx2 sx3 ; scanner registered axis 'X'
sy1 sy2 sy3 ; scanner registered axis 'Y'
sz1 sz2 sz3 ; scanner registered axis 'Z'
r11 r12 r13 0 ; transformation matrix
r21 r22 r23 0 ; this is a simple rotation and translation 4x4 matrix
r31 r32 r33 0 ; just apply to each point to get the transformed coordinate
tr1 tr2 tr3 1 ; use double-precision variables
PTX 文件中單個點的信息與 PTS 文件相同,相比之下,強度值 𝑖𝑛𝑡𝑒𝑛𝑠𝑖𝑡𝑦 做了歸一化處理。
PTX 是一種點雲數據的交換格式,使用 ASCII 編碼。它使用單獨掃描的概念,將每個掃描點都定義在自己的坐標系中,然后將所有這些點"注冊"到單個坐標系中。每個點的數據存儲在它的原始坐標系中,點雲的轉換矩陣作為文件的標頭信息提供。
5. XYZ - Based on Cartesian coordinates
XYZ 文件格式,是一種非標准化的文件格式。它基於笛卡爾坐標 (x, y, z),以 ASCII 文本行形式傳遞數據。
雖然使用 XYZ 文件的程序之間具有廣泛的兼容性,但是由於缺乏標准化的單元和規范,除非提供額外的信息,否則使用這種數據格式存在根本性的缺陷。
XYZ 的一種格式實例:XYZ format - MIT
X1,Y1,Z1,value
X2,Y2,Z2,value
X3,Y3,Z3,value
etc.
stackoverflow 推薦的 ASCII 點雲加載程序:http://www.danielgm.net/cc/
原回答:https://stackoverflow.com/questions/41267210/point-cloud-xyz-format-specification
6. LAS/LAZ - The most common format for exchanging points clouds
LAS/LAZ 參考文檔 https://www.usna.edu/Users/oceano/pguth/md_help/html/las_format.htm
-
LAS 格式旨在作為激光掃描儀點雲數據的交換格式。它由美國攝影測量和遙感學會(ASPRS)維護。
-
LAZ 文件格式則是 LAS 的無損壓縮版本,為了提高效率。LAS 文件格式是二進制的。
LAS 是遙感行業使用最廣泛的點雲數據文件格式。由 ASPRS 維護的官方網站在這里。目前 ASPRS LAS 規范的維護轉移到了GitHub。
References
- Data Formats: 3D, Audio, Image http://paulbourke.net/dataformats/
- 3D file format - http://edutechwiki.unige.ch/en/3D_file_format
- PTS file from Autodesk Recap Pro https://sourceforge.net/p/meshlab/discussion/499532/thread/6a658695/
- File Formats – Exporting your data http://gmv.cast.uark.edu/uncategorized/file-formats-exporting-your-data/
- Point cloud XYZ format https://stackoverflow.com/questions/41267210/point-cloud-xyz-format-specification
- Common point cloud file formats in detail