Python3 Opencv 读取网络图片

from urllib import request
import numpy as np
import cv2

resp = request.urlopen("http://jy.haifandata.com:8881/img/tj.jpg")
image = np.asarray(bytearray(resp.read()), dtype="uint8")
image = cv2.imdecode(image, cv2.IMREAD_COLOR)

cv2.imshow('image', image)
cv2.waitKey(0)
发布了35 篇原创文章 · 获赞 9 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/ZHOUYONGXYZ/article/details/104836949