• (转载)高光谱数据读取by multibandread函数


    原文地址:http://www.cnblogs.com/yxxx/p/6873834.html

    利用matlab中multibandread函数参考数据的hdr文件读取:

    函数格式:

    im = multibandread(filename,dims,precision,... offset,interleave,byteOrder,varargin)

    参数说明:

    DIMS:

        A 3 element vector of integers consisting of [HEIGHT, WIDTH, N].

    PRECISION参数与matlab数据类型相应的关系如下所示:

        precision='uint8=>uint8';%头文件中datatype=1对应ENVI中数据类型为Byte,对应MATLAB中数据类型为uint8

        precision='int16=>int16';%头文件中datatype=2对应ENVI中数据类型为Integer,对应MATLAB中数据类型为int16

        precision='uint16=>uint16';%头文件中datatype=12对应ENVI中数据类型为Unsighed Int,对应MATLAB中数据类型为uint16

        precision='int32=>int32';%头文件中datatype=3对应ENVI中数据类型为Long Integer,对应MATLAB中数据类型为int32

        precision='uint32=>uint32';%头文件中datatype=13对应ENVI中数据类型为Unsighed Long,对应MATLAB中数据类型为uint32

        precision='float32=>float32';%头文件中datatype=4对应ENVI中数据类型为Floating Point,对应MATLAB中数据类型为float32

        precision='double=>double';%头文件中datatype=5对应ENVI中数据类型为Double Precision,对应MATLAB中数据类型为double

    OFFSET:

        可以在hdr文件中找到

    INTERLEAVE:

        The format in which the data is stored.  This can be either 'bsq','bil', or 'bip' for Band-Sequential, Band-Interleaved-by-Line or Band-Interleaved-by-Pixel respectively

        可以在hdr文件中找到:bsq,bil或bip

    BYTEORDER:

        The byte ordering (machine format) in which the data is stored. This can be 'ieee-le' for little-endian or 'ieee-be' for big-endian.

         在hdr文件中找到:ieee-le' 对应 little-endian

                                      'ieee-be' 对应 big-endian.

    这里用hydice中urban的例子:

    其hdr文件为:samples = 307; lines = 307 ;bands = 210 ;header offset = 0; file type = multiband ;data type = 2 ;interleave = bil ;xstart = 1 ;ystart = 1; numpixels = 307; numlines = 307 ;byte order = big endian

    matlab函数为:

    a= multibandread('URBAN', [307,307,210], 'int16', 0, 'bil', 'ieee-be');
  • 相关阅读:
    IE 8兼容:<meta http-equiv="X-UA-Compatible" content="IE=edge" /> X-UA-Compatible的解释
    点击下载,下载图片
    修改输入框placeholder文字默认颜色-webkit-input-placeholder
    rest_framework目录
    Django目录
    python基础内容目录
    hadoop伪分布式搭建
    通过ldap验证svn服务
    LDAP目录服务
    Python基础之字符串拼接简单介绍
  • 原文地址:https://www.cnblogs.com/aodu/p/8081118.html
Copyright © 2020-2023  润新知