MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / draw

Function draw

computer-vision/virtual_keyboard.py:26–42  ·  view source on GitHub ↗
(img, buttonList)

Source from the content-addressed store, hash-verified

24
25
26def draw(img, buttonList):
27 for button in buttonList:
28 x, y = button.pos
29 w, h = button.size
30 cvzone.cornerRect(
31 img,
32 (button.pos[0], button.pos[1], button.size[0], button.size[0]),
33 20,
34 rt=0,
35 )
36 cv2.rectangle(
37 img, button.pos, (int(x + w), int(y + h)), (255, 144, 30), cv2.FILLED
38 )
39 cv2.putText(
40 img, button.text, (x + 20, y + 65), cv2.FONT_HERSHEY_PLAIN, 4, (0, 0, 0), 4
41 )
42 return img
43
44
45def transparent_layout(img, buttonList):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected