【发布时间】:2015-03-12 00:27:44
【问题描述】:
我似乎在读取 Matlab2014a 上的 .tif 文件时遇到问题。每当我使用 imread 函数读取图像时,都会得到以下输出:
Error using rtifc
TIFF library error - 'TIFFReadDirectory: Incorrect count for "SampleFormat".'
Error in readtif (line 48)
[X, map, details] = rtifc(args);
Error in imread (line 415)
[X, map] = feval(fmt_s.read, filename, extraArgs{:});
Error in circles (line 3)
RGB = imread('C:\users\michael\desktop\inkblob12.tif');
我不知道问题是什么或如何解决它,所以任何指针将不胜感激!非常感谢。
编辑:这是信息信息输出:
Filename: 'C:\users\michael\desktop\inkblob12.tif'
FileModDate: '10-Mar-2015 14:06:40'
FileSize: 159794
Format: 'tif'
FormatVersion: []
Width: 250
Height: 250
BitDepth: 32
ColorType: 'truecolor'
FormatSignature: [73 73 42 0]
ByteOrder: 'little-endian'
NewSubFileType: 0
BitsPerSample: [8 8 8 8]
Compression: 'LZW'
PhotometricInterpretation: 'RGB'
StripOffsets: [1x21 double]
SamplesPerPixel: 4
RowsPerStrip: 12
StripByteCounts: [1x21 double]
XResolution: 72.0090
YResolution: 72.0090
ResolutionUnit: 'Inch'
Colormap: []
PlanarConfiguration: 'Chunky'
TileWidth: []
TileLength: []
TileOffsets: []
TileByteCounts: []
Orientation: 1
FillOrder: 1
GrayResponseUnit: 0.0100
MaxSampleValue: [255 255 255 255]
MinSampleValue: [0 0 0 0]
Thresholding: 1
Offset: 159126
Software: 'Matrox Imaging Library [9.00] ...'
Predictor: 'Horizontal differencing'
ExtraSamples: 2
SampleFormat: {'Unsigned integer' 'Unsigned integer' 'Unsigned integer'}
【问题讨论】:
-
您正在阅读的文件是否已损坏/格式不正确?您是否尝试过任何其他 TIFF 文件?
-
@scai 基本上我有一些 1000x944 .tif 图像可以在 matlab 中阅读,但我在绘画中打开这些图像,获取 250x250 的“块”并将它们保存为新的 .tif 文件。我无法打开任何这些新文件,但我不明白为什么会出现问题。
-
我也没有 - 我只是通过在绘图中打开一个文件进行检查,将其保存为 .tif,而 2013b 上的
imread至少可以很好地处理它。您能否编辑问题以显示imfinfo为问题文件之一返回的内容? -
@nkjt 这很烦人,因为我刚刚制作了 165 张这些新图像进行测试!当然,我会在大约半小时内编辑它——我现在正远离我的电脑。谢谢!
-
也许this 会有所帮助。
标签: matlab