imdecode在使用urllib时返回None

时间:2018-01-26 21:29:02

标签: python opencv

我正在尝试从网址中读取img。我的代码在img编码为jpeg时有效,但是,当它的.svg为​​例时,来自openCV的函数imdecode就不起作用了。这是代码:

url_response = urllib.urlopen("https://upload.wikimedia.org/wikipedia/commons/a/ac/BanderaEstepa.svg")
img_array = array(bytearray(url_response.read()), dtype=uint8)
img_url = cv2.imdecode(img_array, 1)

请帮助。提前谢谢。

0 个答案:

没有答案
相关问题