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

Method fingersUp

computer-vision/hand_tracking.py:64–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

62 return self.lmList, bbox
63
64 def fingersUp(self):
65 fingers = []
66
67 try:
68 # Thumb
69 if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0] - 1][1]:
70 fingers.append(1)
71 else:
72 fingers.append(0)
73
74 # Fingers
75 for id in range(1, 5):
76
77 if (
78 self.lmList[self.tipIds[id]][2]
79 < self.lmList[self.tipIds[id] - 2][2]
80 ):
81 fingers.append(1)
82 else:
83 fingers.append(0)
84
85 # totalFingers = fingers.count(1)
86 except:
87 pass
88
89 return fingers
90
91 def findDistance(self, p1, p2, img, draw=True, r=15, t=3):
92 x1, y1 = self.lmList[p1][1:]

Callers 1

virtual_mouse.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected