Matlab imshow不适用于某些tiff文件

ANG*_*-MO 3 matlab tiff imshow

尝试使用某些tiff文件运行imshow时出现以下错误:

??? Error using ==> imageDisplayValidateParams>validateCData at 114
Unsupported dimension

Error in ==> imageDisplayValidateParams at 31
common_args.CData = validateCData(common_args.CData,image_type);

Error in ==> imageDisplayParseInputs at 79
common_args = imageDisplayValidateParams(common_args);

Error in ==> imshow at 199
  [common_args,specific_args] = ...

Error in ==> CellArea at 6
imshow('A1 x20.tiff')
Run Code Online (Sandbox Code Playgroud)

最初imreadimshow我使用来将图像数据存储在matlab变量中,当该数据不起作用时,我使用它来直接获取带有文件名的图像。错误消息是相同的。

我要分析的问题图像是1032x778的tiff文件。我使用Paint制作了一个样本tif图像,该函数没有问题。是否有人知道导致这些错误的原因以及如何显示图像?谢谢

这是其中一张图片的infinfo输出,根据要求

                 Filename: 'A1 x20.tiff'
              FileModDate: '14-Oct-2013 15:49:26'
                 FileSize: 3211714
                   Format: 'tif'
            FormatVersion: []
                    Width: 1032
                   Height: 778
                 BitDepth: 32
                ColorType: 'truecolor'
          FormatSignature: [73 73 42 0]
                ByteOrder: 'little-endian'
           NewSubFileType: 0
            BitsPerSample: [8 8 8 8]
              Compression: 'Uncompressed'
PhotometricInterpretation: 'RGB'
             StripOffsets: 8
          SamplesPerPixel: 4
             RowsPerStrip: 4.2950e+009
          StripByteCounts: 3211584
              XResolution: []
              YResolution: []
           ResolutionUnit: 'None'
                 Colormap: []
      PlanarConfiguration: 'Chunky'
                TileWidth: []
               TileLength: []
              TileOffsets: []
           TileByteCounts: []
              Orientation: 1
                FillOrder: 1
         GrayResponseUnit: 0.0100
           MaxSampleValue: [255 255 255 255]
           MinSampleValue: 0
             Thresholding: 1
                   Offset: 3211592
Run Code Online (Sandbox Code Playgroud)

做x = imread('A1 x20.tiff')然后谁x

Name x
Size 778x1032x4
Bytes 3211584
Class uint8
Attributes
Run Code Online (Sandbox Code Playgroud)

Sha*_*hai 5

出于某种原因,你的TIFF文件有四个通道(自认倒霉多个帧做)size(x,3)==4。我猜第四个是Alpha通道。
imshow可以显示灰度图像,索引图像(带有size(x,3)==1)或真彩色图像(带有size(x,3)==3)。您的图片有4个频道,因此imshow失败了。
要求inshow仅在前三个渠道上工作可以解决问题:

 >> imshow( x(:,:,1:3) );
Run Code Online (Sandbox Code Playgroud)