【发布时间】:2023-03-03 05:09:21
【问题描述】:
我在imread 或cvLoadImage 上打开的tif 图像很少,在Windows 中会给出null data,而在安装ubuntu 时可以方便地处理相同的文件。
运行 imagemagik identify 返回
$identify 60018969.tif
60018969.tif[0] TIFF 1696x2192 1696x2192+0+0 8-bit Grayscale DirectClass 516KB 0.000u 0:00.040
60018969.tif[1] TIFF 1696x2192 1696x2192+0+0 8-bit Grayscale DirectClass 516KB 0.000u 0:00.030
60018969.tif[2] TIFF 1696x2376 1696x2376+0+0 8-bit Grayscale DirectClass 516KB 0.000u 0:00.019
60018969.tif[3] TIFF 1696x2376 1696x2376+0+0 8-bit Grayscale DirectClass 516KB 0.000u 0:00.019
identify: 60018969.tif: wrong data type 4 for "JpegProc"; tag ignored. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/706.
经过大量谷歌搜索,opencv 可以读取未压缩的 tiff 图像,但对于压缩类型的 tiff,则需要 libtiff。我多次尝试重新安装/重新配置 opencv,但找不到加载压缩 tiff 图像的方法。
在 OpenCV 2.4.9 的 ubuntu 安装中处理相同的图像。我需要在 windows 中为 opencv libtiff 构建哪个编解码器以及如何构建?
请帮忙。
编辑:随着时间的推移。我尝试使用libtiff 库读取文件,但它无法读取文件并给出错误"deprecated and troublesome old-style jpeg compression mode please convert to new-style jpeg compression"。我确保 libtiff 安装了以下编解码器
Support for external codecs:
ZLIB support: yes
Pixar log-format algorithm: yes
JPEG support: yes
Old JPEG support: yes
JPEG 8/12 bit dual mode: no
ISO JBIG support: yes
LZMA2 support: no
C++ support: yes
OpenGL support: no
询问的示例文件
【问题讨论】:
-
你能附上一个示例 TIF 文件吗?
标签: opencv mingw tiff image-compression