readPointCloud
从LAS或LAZ文件读取点云数据
句法
Description
[[
读取指定的点属性ptcloud
,,,,ptattributes
] = readPointCloud(Lasreader
,“属性”,ptAtt
)ptAtt
from a LAS or LAZ file. In addition to the point cloud, the function returns the specified attributes of each point in the point cloud.
[[___] = readPointCloud(___,,,,
除了以前的语法中的任何参数组合外,还使用一个或多个名称值对参数指定选项。例如,名称,价值
)“ ROI”
,,,,[5 10 5 10 5 10]
sets the region of interest (ROI) in which the function reads the point cloud.
Examples
Read Point Cloud Data from LAZ File
This example shows how to read and visualize point cloud data from a LAS / LAZ file.
创建一个lasFileReader
LAZ文件的对象。然后,使用readPointCloud
function to read point cloud data from the LAZ file and generate apointCloud
目的。
创建一个lasFileReader
目的to access the LAZ file data.
path = fullfile(toolboxdir(“ LIDAR”),“ Lidardata”,,,,。。。"las",,,,“ Aeriallidardata.laz”);Lasreader= lasFileReader(path);
使用laz文件读取点云数据readPointCloud
功能。
ptcloud= ReadPointCloud(Lasreader);
可视化点云。
figure pcshow(ptCloud.Location)
Visualize Point Cloud Based on Classification Data from LAZ File
基于LAZ文件的分类数据划分和可视化点云数据。
创建一个lasFileReader
对象可以从LAZ文件访问数据。
path = fullfile(toolboxdir(“ LIDAR”),“ Lidardata”,,,,。。。"las",,,,“ Aeriallidardata.laz”);Lasreader= lasFileReader(path);
使用LAZ文件读取点云数据和关联的分类点属性readPointCloud
功能。
[ptcloud,pointattributes] = readpointcloud(lasreader,,"Attributes",,,,“分类”);
根据其分类属性为点上色。将标签图像重塑为点云的形状。
labels = label2rgb(pointAttributes.Classification);colordata = reshape(标签,[],3);
可视化颜色编码点云。
图PCSHOW(PTCLOUD.Location,Colordata)
输入参数
Lasreader
-LAS or LAZ file reader
lasFileReader
目的
LAS或LAZ文件读取器,指定为lasFileReader
目的。
ptAtt
-Point attributes
[](default) |character vector|字符串标量|细胞array of character vectors|字符串向量
点属性,指定为字符向量,字符串标量,字符矢量的单元格数或字符串向量。输入必须包含其中一个或多个选项:
“分类”
“ gpstimestamp”
"LaserReturn"
“数字”
"NearIR"
“扫描”
“用户数据”
“ Pointsourceid”
“ ScannerChannel”
"ScanDirectionFlag"
“ EdgeOfflightlineFlag”
"WaveformData"
该函数返回一个中每个点的指定属性LIDARPOINTATTRIBUTS
目的,ptattributes
。这unspecified attributes are returned empty.
Data Types:char
|string
|细胞
名称值参数
将可选的参数对Name1=Value1,...,NameN=ValueN
,,,,whereName
是参数名称和价值
一世s the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and encloseName
一世n quotes.
Example:“ ROI”
,,,,[5 10 5 10 5 10]
sets the region of interest (ROI) in which the function reads the point cloud.
ROI
-ROIto read in the point cloud
[-inf inf -Inf inf -Inf inf]
(default) |six-element row vector
ROIto read in the point cloud, specified as the comma-separated pair consisting of'ROI'
and a six-element row vector in the order, [XminX最大限度yminy最大限度zminz最大限度]. Each element must be a real number. The values specify the ROI boundaries in theX- ,,y-, 和z-axis.
Data Types:single
|double
|int8
|一世nt16
|一世nt32
|一世nt64
|uint8
|uint16
|uint32
|Uint64
gpstimespan
-GPS时间戳范围
lasreader.gpstimelimits
(default) |两元素向量期间
对象
GPS时间戳范围,指定为逗号分隔对'gpstimespan'
and a two-element vector of期间
对象,表示[startTimeendTime]. The timestamps must be positive.
Data Types:期间
Classification
-兴趣分类数字
0:lasreader.numclasses -1
(default) |vector of valid classification numbers
兴趣的分类数字,指定为逗号分隔对'分类'
以及有效分类数字的向量。
有效分类数字范围为0到255。
Classification Number | 分类类型 |
---|---|
0 |
创建,从未分类 |
1 |
Unclassified |
2 |
地面 |
3 |
Low vegetation |
4 |
中等植被 |
5 |
高植被 |
6 |
建造 |
7 |
低点(噪声) |
8 |
预订的 |
9 |
水 |
10 |
Rail |
11 |
路面 |
12 |
预订的 |
13 |
Wire guard (shield) |
14 |
电线导体(相) |
15 |
Transmission tower |
16 |
Wire-structure connector (insulator) |
17 |
桥甲板 |
18 |
高噪音 |
19 |
Overhead structure |
20 |
Ignored ground |
21 |
雪 |
22 |
Temporal exclusion |
23 -63 |
预订的 |
64 -255 |
用户自定义 |
这se are standard class names and class-object mappings. The class definition and mapping might differ from the standard depending on the application that created the LAS or LAZ file.
Data Types:single
|double
|int8
|一世nt16
|一世nt32
|一世nt64
|uint8
|uint16
|uint32
|Uint64
激光
-分离返回号的积分数
1:lasReader.NumReturn
(default) |有效退货号码的向量
分离其返回号的点数,指定为逗号分隔对“激光”
以及有效返回号码的向量。有效的返回号码是整数从1到该值NumReturns
输入的属性lasFileReader
目的。For each value,一世,,,,一世n the vector, the function returns a point cloud of only the points that have一世作为他们的返回号码。
这return number is the number of times a laser pulse reflects back to the sensor.
Data Types:single
|double
|int8
|一世nt16
|一世nt32
|一世nt64
|uint8
|uint16
|uint32
|Uint64
Output Arguments
ptcloud
-Point cloud
pointCloud
目的
点云,返回pointCloud
目的。
ptattributes
- 点属性数据
LIDARPOINTATTRIBUTS
目的
点属性数据,返回为LIDARPOINTATTRIBUTS
目的。该对象包含指定属性的数据ptAtt
每个点ptcloud
输出。
版本历史记录
在R2020b中引入R2022A:Additional point attributes
您现在可以将这些附加属性指定到ptAtt
argument:
“用户数据”
“ Pointsourceid”
“ ScannerChannel”
"ScanDirectionFlag"
“ EdgeFlightline”
"WaveformData"
R2022A:激光
renamed to激光
R2022A中的行为发生了变化
这激光
一世s now called激光
。行为没有改变。
R2022a:点属性返回为对象
R2022A中的行为发生了变化
这readPointCloud
function returns theptattributes
论点为LIDARPOINTATTRIBUTS
对象而不是作为结构。
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
您单击了与此MATLAB命令相对应的链接:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择一个网站
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:。
您还可以从以下列表中选择一个网站:
How to Get Best Site Performance
选择中国网站(中文或英语)以获得最佳场地性能。其他Mathworks乡村网站未针对您所在的访问进行优化。
美洲
- América Latina(Español)
- 加拿大(English)
- 美国(English)
欧洲
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- 葡萄牙(English)
- Sweden(English)
- 瑞士
- United Kingdom(English)