如何在Windows中使用OpenCV读取tiff文件

时间:2017-12-13 05:42:22

标签: c++ opencv tiff

我在Windows操作系统中安装了OpenCV,并成功配置了相应的Visual Studio项目。但是当我使用imread读取tiff图像文件时,Mat对象将为空。如果我将文件转换为bmp格式,程序可以正常工作。我想知道OpenCV如何在Windows中进行I / O操作。

我的OpenCV版本是2.4.13,我正在使用VS 2013。

运行“magick identify”后,输出为:

Image: TBAL2015032700100902012.tif
Format: TIFF (Tagged Image File Format)
Mime type: image/tiff
Class: DirectClass
Geometry: 2502x1505+0+0
Resolution: 300x300
Print size: 8.34x5.01667
Units: PixelsPerInch
Type: TrueColor
Endianess: LSB
Colorspace: sRGB
Depth: 8-bit
Channel depth:
  Red: 8-bit
  Green: 8-bit
  Blue: 8-bit
Channel statistics:
  Pixels: 3765510
  Red:
    min: 0  (0)
    max: 255 (1)
    mean: 199.179 (0.781094)
    standard deviation: 44.2111 (0.173377)
    kurtosis: 9.97873
    skewness: -3.17169
    entropy: 0.774441
  Green:
    min: 0  (0)
    max: 255 (1)
    mean: 204.13 (0.800508)
    standard deviation: 41.8485 (0.164112)
    kurtosis: 9.24617
    skewness: -3.00098
    entropy: 0.77394
  Blue:
    min: 0  (0)
    max: 255 (1)
    mean: 156.85 (0.615098)
    standard deviation: 41.3859 (0.162298)
    kurtosis: 1.57158
    skewness: -1.13336
    entropy: 0.89716
Image statistics:
  Overall:
    min: 0  (0)
    max: 255 (1)
    mean: 186.72 (0.732233)
    standard deviation: 47.5017 (0.186281)
    kurtosis: 3.30247
    skewness: -1.81231
    entropy: 0.81518
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
  red primary: (0.64,0.33)
  green primary: (0.3,0.6)
  blue primary: (0.15,0.06)
  white point: (0.3127,0.329)
Matte color: grey74
Background color: white
Border color: srgb(223,223,223)
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 2502x1505+0+0
Dispose: Undefined
Iterations: 0
Compression: JPEG
Orientation: TopLeft
Properties:
  comment:                                                                                                            
  date:create: 2017-12-08T16:15:53+08:00
  date:modify: 2015-03-27T10:25:22+08:00
  jpeg:sampling-factor: 2x1
  signature: 70f8c75014e79eb786765d727ccb564688c3da3c3d5f9f0b4c56f259e2d88625
  tiff:alpha: unspecified
  tiff:artist: SysAdmin
  tiff:document: DN0P46158952        0000000022000000053700000.----!--
  tiff:endian: lsb
  tiff:make: Eastman Kodak
  tiff:model: Kodak Scanner: i1405
  tiff:photometric: YCBCR
  tiff:rows-per-strip: 1505
  tiff:software: KODAK Capture Desktop 1.2
  tiff:timestamp: 2015.03.27 10:25:22
Artifacts:
  verbose: true
Tainted: False
Filesize: 619460B
Number pixels: 3765510
Pixels per second: 83.6779MB
User time: 0.047u
Elapsed time: 0:01.045
Version: ImageMagick 7.0.7-14 Q16 x64 2017-12-06 http://www.imagemagick.org

0 个答案:

没有答案