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

Function auto_canny

imutils/convenience.py:142–152  ·  view source on GitHub ↗
(image, sigma=0.33)

Source from the content-addressed store, hash-verified

140 return image
141
142def auto_canny(image, sigma=0.33):
143 # compute the median of the single channel pixel intensities
144 v = np.median(image)
145
146 # apply automatic Canny edge detection using the computed median
147 lower = int(max(0, (1.0 - sigma) * v))
148 upper = int(min(255, (1.0 + sigma) * v))
149 edged = cv2.Canny(image, lower, upper)
150
151 # return the edged image
152 return edged
153
154def grab_contours(cnts):
155 # if the length the contours tuple returned by cv2.findContours

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…