Ask Your Question
1

OpenCV does not decode gif

asked 2015-03-13 05:41:12 -0600

thdrksdfthmn gravatar image

updated 2017-09-06 18:14:33 -0600

I have found that if I want to decode an image, I always get an empty Mat. Then I have found that the picture.jpg is in fact a gif. Is there a way to open a gif that is just an image?

Just like a parenthesis: why it is a gif if the link is ending with .gif, resulting in a jfif header?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2017-09-30 14:03:25 -0600

updated 2017-10-01 00:06:46 -0600

the answer is YES if you compile OpenCV with GDAL support.

In the case you set WITH_GDAL flag to true in CMake and IMREAD_LOAD_GDAL to load the image, then GDAL driver will be used in order to decode the image by supporting the following formats: Raster,Vector.

image = imread( inputImage, IMREAD_LOAD_GDAL);

another way ( simplier ) use VideoCapture to open gif image

edit flag offensive delete link more
1

answered 2015-03-13 06:02:45 -0600

berak gravatar image

no, there's no gif decompression built in. (probably still a patent issue)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-03-13 05:41:12 -0600

Seen: 2,527 times

Last updated: Oct 01 '17