I have loop in my C++ code to open and process a set of images. One of those is
https://i.stack.imgur.com/rUJnp.gif https://i.stack.imgur.com/rUJnp.gif
imread
无法打开此特定的一个。imread().data
is NULL
.
FWIW,我在CentOS
并使用最新的opencv 2.4.8。有没有什么办法解决这一问题?如果不是,最简单的方法是什么可能用另一个 C++ 图像库打开它并将其转换为cv::Mat
?
From OpenCV http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html?highlight=imread#imread有关的文档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)
So .gif
OpenCV 不支持格式,因此imread
正在返回NULL
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)