在Octave中加载高光谱图像

时间:2017-07-21 08:12:24

标签: image matlab octave

使用Matlab我可以看到我图像的第4个通道,但不能看到Octave:

以下图像(I)的Matlab代码给出了

  

我= imread(' ../ rec3 / 2012R_1_1.tif')[nr nc nb] =尺寸(I);
  NB

它给出了:

  

nb = 4

其中nb是频道编号,I是64位图像(3057x1210)

但对于相同的图像,Octave给出:

  

nb = 3

我是否应该加载任何特殊包以便能够处理高光谱图像?

修改

Octave的imfinfo输出:

ans =

包含字段的标量结构:

Filename = c:/2012R_1_1.tif
FileModDate = 10-May-2016 20:02:10
FileSize =  23140500
Format = TIFF
FormatVersion =
Width =  3057
Height =  1210
BitDepth =  16
ColorType = truecolor
DelayTime = 0
DisposalMethod =
LoopCount = 0
ByteOrder = undefined
Gamma = 0
Chromaticities = [](1x0)
Comment =
Quality =  75
Compression = undefined
Colormap = [](0x0)
Orientation =  1
ResolutionUnit = Inch
XResolution = 0
YResolution = 0
Software =
Make =
Model =
DateTime =
ImageDescription =
Artist =
Copyright =

,对于Matlab

Filename: 'c:\2012R_...'
              FileModDate: '10-máj.-2016 18:02:10'
                 FileSize: 23140500
                   Format: 'tif'
            FormatVersion: []
                    Width: 3057
                   Height: 1210
                 BitDepth: 64
                ColorType: 'truecolor'
          FormatSignature: [73 73 42 0]
                ByteOrder: 'little-endian'
           NewSubFileType: 0
            BitsPerSample: [16 16 16 16]
              Compression: 'LZW'
PhotometricInterpretation: 'RGB'
             StripOffsets: [1x38 double]
          SamplesPerPixel: 4
             RowsPerStrip: 32
          StripByteCounts: [1x38 double]
              XResolution: []
              YResolution: []
           ResolutionUnit: 'Inch'
                 Colormap: []
      PlanarConfiguration: 'Chunky'
                TileWidth: []
               TileLength: []
              TileOffsets: []
           TileByteCounts: []
              Orientation: 1
                FillOrder: 1
         GrayResponseUnit: 0.0100
           MaxSampleValue: [65535 65535 65535 65535]
           MinSampleValue: [0 0 0 0]
             Thresholding: 1
                   Offset: 23139726
                Predictor: 'Horizontal differencing'
             ExtraSamples: 0
             SampleFormat: {'Unsigned integer'  'Unsigned integer'  'Unsigned integer'  'Unsigned integer'}
       ModelPixelScaleTag: [1 1 1]
         ModelTiepointTag: [0 0 0 6.7143e+05 5.1757e+06 0]
       GeoKeyDirectoryTag: [1x52 double]
       GeoDoubleParamsTag: []
        GeoAsciiParamsTag: ''

1 个答案:

答案 0 :(得分:2)

您可以使用mapping包中的rasterreadgdalread功能来阅读高光谱图像。

pkg load mapping
ras = rasterread("myfile.tif");
I = ras.data;

[~,~,I]= gdalread("myfile.tif");