| MATLAB Function Reference | ![]() |
Syntax
info = imfinfo(filename,fmt)
info = imfinfo(filename)
Description
info = imfinfo(filename,fmt) 回傳圖檔概念之相關資訊欄位的結構,filename 為圖檔的檔名,fmt 則為檔案的格式,皆以字串的形式來表示。檔案必須放在現在工作的目錄下或是 MATLAB 的路徑。若 imfinfo 指令找不到檔名為 filename 的檔案,則它會嘗試去尋找檔名為 filename.fmt的圖檔。
若檔案 filename 為 TIFF 或 HDF 的格式,且其檔案中的影像為一張以上,則 info 會以一個結構式陣列的資料型態來儲存圖檔資訊,而每一陣列的元素(即為一獨立結構)對應到檔案中的每一張影像。舉例來說,info(3) 是儲存圖檔內第三張影像的資訊。
針對每個不同的圖檔,其 info 也會有所不同。然而前九個欄位卻一定是相同的。下表列出這九個欄位及它們的值。
info = imfinfo(filename) 將會依其檔案的內容推斷其格式。
Example
info = imfinfo('canoe.tif')
info =
Filename:'canoe.tif'
FileModDate: '25-Oct-1996 22:10:39'
FileSize: 69708
Format: 'tif'
FormatVersion: []
Width: 346
Height: 207
BitDepth: 8
ColorType: 'indexed'
FormatSignature: [73 73 42 0]
ByteOrder: 'little-endian'
NewSubfileType: 0
BitsPerSample: 8
Compression: 'PackBits'
PhotometricInterpretation: 'RGB Palette'
StripOffsets: [ 9x1 double]
SamplesPerPixel: 1
RowsPerStrip: 23
StripByteCounts: [ 9x1 double]
XResolution: 72
YResolution: 72
ResolutionUnit: 'Inch'
Colormap: [256x3 double]
PlanarConfiguration: 'Chunky'
TileWidth: []
TileLength: []
TileOffsets: []
TileByteCounts: []
Orientation: 1
FillOrder: 1
GrayResponseUnit: 0.0100
MaxSampleValue: 255
MinSampleValue: 0
Thresholding: 1
See Also
| imagesc | import | ![]() |