opencv 2.4.5无法在Windows中正确加载tif图像文件 [英] opencv 2.4.5 unable to load tif image file properly in windows

查看:445
本文介绍了opencv 2.4.5无法在Windows中正确加载tif图像文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows上打开imreadcvLoadImage给出null data的tif图像很少,而在ubuntu安装中可以方便地处理相同的文件.

I have few tif images which open on imread or cvLoadImage gives null data in windows whereas the same file is processed conveniently on ubuntu installation.

运行imagemagik identify返回

Running imagemagik identify returns

$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.

经过大量的google搜索,opencv可以读取未压缩的tiff图像,但是对于压缩类型,tiff libtiff是必需的.我多次尝试重新安装/重新配置opencv,但找不到加载压缩的tiff图像的方法.

After a lot of google search ,opencv can read uncompressed tiff images, but for compressed types tiff libtiff is needed. I tried re-intalling/re-configuring opencv many times but could not find a way to load compressed tiff images.

在OpenCV 2.4.9的ubuntu安装中会处理相同的映像.我需要在Windows中为opencv libtiff构建哪种编解码器,以及如何?

The same image is processed in ubuntu installation of OpenCV 2.4.9. Which codec I need to build in windows for opencv libtiff and how?

请帮助.

在一段时间内.我尝试使用libtiff库读取文件,但无法读取给出错误"deprecated and troublesome old-style jpeg compression mode please convert to new-style jpeg compression"的文件.我确保libtiff已安装以下编解码器

During the course of time. I tried reading the file using libtiff library and it failed to read the file giving an error "deprecated and troublesome old-style jpeg compression mode please convert to new-style jpeg compression". I made sure that libtiff had following codecs installed

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

要求的示例文件

推荐答案

您应该意识到,旧式JPEG" TIFF是Microsoft(IIRC)在不咨询任何人的情况下将TIFF压延的扩展,他们这样做是糟糕.在所有TIFF压缩方案中,都存在不符合规范的有趣"情况,或多或少地侵入了各种编解码器以实现兼容性,但是就这方面而言,老式JPEG是万王之王,而我已经废the了.看到(我在一家制造TIFF编解码器的公司工作)会使您的头发变白.对于一个事实,我知道至少有六种类别的老式JPEG TIFF,我们可以读取该libtiff无法读取的内容.

You should be aware that "Old Style JPEG" TIFFs are an extension that was glommed on to TIFF by Microsoft (IIRC) without consulting anyone and they did so rather poorly. Within all TIFF compression schemes there are "interesting" cases that are non-spec compliant and are more or less hacked into various codecs for compatibility, but old-style JPEG is the king of all kings in that regard and the crap that I've seen (I work for a company that makes a TIFF codec) would turn your hair white. I know for a fact that we have at least a half-dozen classes of old-style JPEG TIFFs that we can read that libtiff cannot.

这篇关于opencv 2.4.5无法在Windows中正确加载tif图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆