OpenCV unable to read certain jpg's [closed]

asked 2016-02-08 15:25:40 -0600

brianchu gravatar image

updated 2016-02-09 02:31:56 -0600

berak gravatar image

OpenCV can't open certain jpg files:

import cv2

img = cv2.imread('/absolute_path/sun_afmzwxkzmxkbamqi.jpg',0)

img is None # True

Image can be downloaded here: https://www.dropbox.com/s/aaldwlvp2zw...

Specs:

OpenCV 3.1.0

Ubuntu 14.04.1 LTS

Installed via Anaconda.

Media I/O: ZLib: build (ver 1.2.8) JPEG: build (ver 90) WEBP: build (ver 0.3.1) PNG: build (ver 1.6.19) TIFF: build (ver 42 - 4.0.2) JPEG 2000: build (ver 1.900.1) OpenEXR: build (ver 1.7.1) GDAL: NO

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-07 13:27:26.166396

Comments

works absolutely fine here. what's your os ? opencv version ? did you build from src ?

try a print cv2.getBuildInformation() , what does the ' Media I/O:' section look like ?

berak gravatar imageberak ( 2016-02-09 00:04:36 -0600 )edit
1

updated question!

brianchu gravatar imagebrianchu ( 2016-02-09 00:27:53 -0600 )edit

I think opencv cannot load gif image and your image is in GIF format

LBerger gravatar imageLBerger ( 2016-02-09 02:03:06 -0600 )edit

@LBerger, why do you think, it's a gif ?

berak gravatar imageberak ( 2016-02-09 02:19:05 -0600 )edit
1

I have download image using given link after edit image using notepad++. Files begin with GIF89a

LBerger gravatar imageLBerger ( 2016-02-09 02:27:34 -0600 )edit

^^ hmm, i see. so just copying the img link to this site must have made a conversion...

i guess, it's better to remove it again ?

berak gravatar imageberak ( 2016-02-09 02:29:57 -0600 )edit