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

Function rect_to_bb

imutils/face_utils/helpers.py:32–42  ·  view source on GitHub ↗
(rect)

Source from the content-addressed store, hash-verified

30FACIAL_LANDMARKS_IDXS = FACIAL_LANDMARKS_68_IDXS
31
32def rect_to_bb(rect):
33 # take a bounding predicted by dlib and convert it
34 # to the format (x, y, w, h) as we would normally do
35 # with OpenCV
36 x = rect.left()
37 y = rect.top()
38 w = rect.right() - x
39 h = rect.bottom() - y
40
41 # return a tuple of (x, y, w, h)
42 return (x, y, w, h)
43
44def shape_to_np(shape, dtype="int"):
45 # initialize the list of (x, y)-coordinates

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…