2017-07-21 3 views
1

Matlab je peux voir le 4ème canal de mon image, mais pas avec Octave:Chargement hyperspectrale dans Octave

donne

le code Matlab suivant pour l'image (I) I = imread (» ../rec3/2012R_1_1.tif ') [nr nc nb] = taille (I);
nb

il donne:

nb = 4

nb est le numéro de canal et I est un 64 bit image (3057x1210)

Mais pour la même image Octave donne:

nb = 3

Dois-je charger un paquet spécial afin de pouvoir travailler avec des images hyperspectrales?

EDIT

La sortie du imfinfo pour Octave:

ans =

Structure scalaire contenant les champs:

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 = 

et pour 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: '' 
+0

pourrait vous fournir une image s'il vous plaît exemple? – Ash

+0

Afficher aussi le code. –

+0

Salut, je viens d'utiliser: I = imread ('../ rec3/2012R_1_1.tif'); alors les lignes indiquées ci-dessus – Kristan

Répondre

2

Vous pouvez utiliser les fonctions rasterread ou gdalread du paquet mapping lire hyperspectrale.

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

ou

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