MCPcopy Create free account
hub / github.com/PyImageSearch/imutils / url_to_image

Function url_to_image

imutils/convenience.py:132–140  ·  view source on GitHub ↗
(url, readFlag=cv2.IMREAD_COLOR)

Source from the content-addressed store, hash-verified

130 return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
131
132def url_to_image(url, readFlag=cv2.IMREAD_COLOR):
133 # download the image, convert it to a NumPy array, and then read
134 # it into OpenCV format
135 resp = urlopen(url)
136 image = np.asarray(bytearray(resp.read()), dtype="uint8")
137 image = cv2.imdecode(image, readFlag)
138
139 # return the image
140 return image
141
142def auto_canny(image, sigma=0.33):
143 # compute the median of the single channel pixel intensities

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…