OpenCV imread不起作用

Moh*_*imi 3 c++ opencv

我在我的C++代码中循环打开并处理一组图像.其中之一就是 样本输入 http://i.stack.imgur.com/rUJnp.gif

imread无法打开这个特定的.imread().dataNULL.

FWIW,我正在CentOS使用最新的opencv 2.4.8.有没有什么办法解决这一问题?如果不是,用另一个C++图像库打开它并将其转换为最简单的方法是什么cv::Mat

Man*_*mar 14

来自OpenCV文档imread

该函数imread从指定文件加载图像并返回它.如果无法读取图像(由于文件丢失,权限不正确,格式不受支持或无效),该函数将返回一个空矩阵(Mat::data==NULL).目前,支持以下文件格式:

    Windows bitmaps - *.bmp, *.dib (always supported)
    JPEG files - *.jpeg, *.jpg, *.jpe (see the Notes section)
    JPEG 2000 files - *.jp2 (see the Notes section)
    Portable Network Graphics - *.png (see the Notes section)
    Portable image format - *.pbm, *.pgm, *.ppm (always supported)
    Sun rasters - *.sr, *.ras (always supported)
    TIFF files - *.tiff, *.tif (see the Notes section)
Run Code Online (Sandbox Code Playgroud)

因此.gifOpenCV不支持格式,因此imread返回NULL.