资源简介
该代码能够实现从las点云中读取坐标信息、强度信息、回波次数等
代码片段和文件信息
function outfile = LASRead (infilenameoutfilenamenFields)
% LASREAD reads in files in LAS 1.1 format and outputs comma delimited text files
%
% INPUT
% infilename: input file name in LAS 1.1 format
% (for example ‘myinfile.las‘)
% outfilename: output file name in text format
% (for example ‘myoutfile.txt‘)
% nFields: default value of 1 outputs X Y and Z coordinates of the
% point - [X Y Z].
% A value of 2 gives Intensity as an additional attribute - [X Y Z I].
% A value of 3 gives the Return number and the Number of returns
% in addition to the above - [X Y Z I R N].
%
% OUTPUT
% outfile: the output matrix
%
% EXAMPLE
% A = LASRead (‘infile.las‘ ‘outfile.txt‘ 3)
%
% Cici Alexander
% September 2008 (updated 26.09.2008)
% Open the file
fid =fopen(infilename);
% Check whether the file is valid
if fid == -1
error(‘Error opening file‘)
end
% Check whether the LAS format is 1.1
% fseek(fid 24 ‘bof‘);
% VersionMajor = fread(fid1‘uchar‘);
% VersionMinor = fread(fid1‘uchar‘);
% if VersionMajor ~= 1 || VersionMinor ~= 1
% error(‘LAS format is not 1.1‘)
% end
% Read in the offset to point data
fseek(fid 96 ‘bof‘);
OffsetToPointData = fread(fid1‘uint32‘);
% Read in the scale factors and offsets required to calculate the coordinates
fseek(fid 131 ‘bof‘);
XScaleFactor = fread(fid1‘double‘);
YScaleFactor = fread(fid1‘double‘);
ZScaleFactor = fread(fid1‘double‘);
XOffset = fread(fid1‘double‘);
YOffset = fread(fid1‘double‘);
ZOffset = fread(fid1‘double‘);
% The number of bytes from the begin
- 上一篇:雷达回波加天线方向图模拟程序
- 下一篇:基于Matlab的RC一阶电路仿真
相关资源
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
- matlab程序用Hopfield网络解决TSP
- 实例matlab 编程100个常用程序
- 用MATLAB(BPSK仿真 直接扩频)
- 最小二乘法曲线拟合(MATLAB)
评论
共有 条评论