国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網站 > WEB開發 > 正文

【Matlab Computer Vision System ToolBox】學習筆記-4 -點云文件PLY格式

2024-04-27 15:16:35
字體:
來源:轉載
供稿:網友

本系列博客將介紹Matlab中機器視覺工具箱的應用,部分案例,主要關于點云處理方面,更多內容見Matlab官方文檔。如有翻譯錯誤請批評指正!所有代碼經自己運行測試通過。轉載請注明鏈接 :http://blog.csdn.NET/kaspar1992

The PLY Format

Matlab視覺工具箱點云只支持XYZ坐標及顏色屬性。

1. File Header 頭部

PLY文件頭部例子:

ply                                                       //file IDformat binary_big_endian 1.0                              //specify data format and versionelement vertex 9200                                       //define "vertex" element 頂點元素PRoperty float xproperty float yproperty float zelement face 18000                                         //define "face" elementproperty list uchar int vertex_indicesend_header                                                 //data starts after this line

文件已 “ply” 開始,表示這是一個PLY文件。頭部必須包含以下語法:

format <data format> <PLY version><data format>  可以是 ascii 表示數據以文本存儲; binary_little_endian  和 binary_big_endian  表示二進制數據存儲。

元素以  “element”  開始,并有元素屬性值。

element <element name><number in file>property <data type><property name 1>property <data type><property name 2>property <data type><property name 3>...例如,
element vertex 9200定義了一個 vertex (頂點),有9200個元素,每個元素由 property ( 屬性) 描述,這里有兩種 屬性,標量和列表。

標量的定義語法:

property <data type><property name>

其中 <data type>可以是以下類型:

列表語法定義如下:

property list <count data type><data type><property name>例如:property list uchar int vertex_index

定義了以一個字節整形開始的 頂點索引,這對于存儲在一個臉中不同的頂點較復雜的多邊形數據很有用。

頭部還可以包括 comments  ,可以提供文件的作者信息,文件描述,數據來源和其他文字信息,格式如下:

comment<comment text>

2. Data 數據

數據存儲格式在文件頭部已經定義,ASCII或者二進制,數據按文件頭部定義順序存儲。在上面的例子中,9200個頂點,每個頂點有xyz屬性值。文件數據如下:

float vertex[1].xfloat vertex[1].yfloat vertex[1].zfloat vertex[2].xfloat vertex[2].yfloat vertex[2].z...float vertex[9200].xfloat vertex[9200].yfloat vertex[9200].z

通常,每個元素的值按行一次性存儲:

<property 1><property 2> ... <property N> element[1]<property 1><property 2> ... <property N> element[2]

...

列表以一個count開始,后面有scalars。例如上面的face,列表屬性有 vertex_indices ,uchar 的 count 和 in 的 scalar

uchar countint face[1].vertex_indices[1]int face[1].vertex_indices[2]int face[1].vertex_indices[3]...int face[1].vertex_indices[count]uchar countint face[2].vertex_indices[1]int face[2].vertex_indices[2]int face[2].vertex_indices[3]...int face[2].vertex_indices[count]...

3. Common Elements and Properties 通用元素和屬性

 

因為點云格式比較復雜,包括很多的元素及屬性,一個通用的屬性可以在不同的程序中使用,Turk建議元素和屬性使用一些標準。

4. More

更多關于PLY的內容,請點擊鏈接 Greg Turk’s article on the PLY format

看到這里筆者想到之前的筆記中使用的 teapot.ply  ,于是找出打開,看看是不是上述的說明,截圖如下,清晰明了。本博文對于以后自己建立點云有很大幫助。(點云數據那么多,上千上萬,自己一個一個輸入嗎難道。。。)

 

 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 西乌| 永丰县| 永安市| 新巴尔虎左旗| 丰镇市| 惠安县| 崇州市| 阿图什市| 宿松县| 从江县| 镇宁| 咸阳市| 攀枝花市| 中西区| 夹江县| 丰都县| 武鸣县| 拜泉县| 临汾市| 灵石县| 渭南市| 义乌市| 乐都县| 霍山县| 博白县| 桓仁| 固安县| 沙湾县| 大关县| 内丘县| 大港区| 海伦市| 慈溪市| 嘉峪关市| 三原县| 华容县| 张家川| 津南区| 天柱县| 竹溪县| 永泰县|