2011-04-04 81 views
0

imfinfo我的形象,得到下述:約TIFF圖像

Filename: 'drosophila.tif' 
        FileModDate: '10-Nov-2009 18:52:42' 
        FileSize: 264768 
         Format: 'tif' 
       FormatVersion: [] 
         Width: 512 
         Height: 512 
        BitDepth: 8 
        ColorType: 'grayscale' 
       FormatSignature: [73 73 42 0] 
        ByteOrder: 'little-endian' 
       NewSubFileType: 0 
       BitsPerSample: 8 
        Compression: 'PackBits' 
    PhotometricInterpretation: 'BlackIsZero' 
       StripOffsets: [32x1 double] 
       SamplesPerPixel: 1 
       RowsPerStrip: 16 
       StripByteCounts: [32x1 double] 
        XResolution: 72 
        YResolution: 72 
       ResolutionUnit: 'Inch' 
        Colormap: [] 
      PlanarConfiguration: 'Chunky' 
        TileWidth: [] 
        TileLength: [] 
        TileOffsets: [] 
       TileByteCounts: [] 
        Orientation: 1 
        FillOrder: 1 
      GrayResponseUnit: 0.0100 
       MaxSampleValue: 255 
       MinSampleValue: 0 
       Thresholding: 1 
         Offset: 264322 

多少條呢?

回答

2

通用邏輯:

ceil(Height/RowsPerStrip) 

的TIFF規範指出,最後帶不必是完整(因此CEIL調用)。

或者,信息結構中StripOffset的長度。顧名思義,這是文件中每個條帶的字節偏移矢量(因此每個條帶必須有一個偏移量)。

1

32.

Height: 512 
RowsPerStrip: 16 

512 = 2^9; 16 = 2^4。分拿到2^5分32

+0

你能解釋它背後的理論嗎?我認爲這個32被用作帶偏移 – user1234 2011-04-04 17:08:29

+0

閱讀任何搜索引擎很容易找到的TIFF 6.0規範。 – DarenW 2011-04-05 02:56:05