Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshbansal8705 authored May 26, 2021
1 parent 5d7a8d2 commit 67f1679
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
# HandTrackingModule
This is a simplified version of mediapipe to do hand tracking

Here is the example code to run the file:

import cv2
from handtrackingmodule import FindHands

cap = cv2.VideoCapture(0)
detector = FindHands()

while True:
succeed, img = cap.read()
hand1_positions = detector.getPosition(img, range(21), draw=False)
hand2_positions = detector.getPosition(img, range(21), hand_no=1, draw=False)
for pos in hand1_positions:
cv2.circle(img, pos, 5, (0,255,0), cv2.FILLED)
for pos in hand2_positions:
cv2.circle(img, pos, 5, (255,0,0), cv2.FILLED)
print("Index finger up:", detector.index_finger_up(img))
print("Middle finger up:", detector.middle_finger_up(img))
print("Ring finger up:", detector.ring_finger_up(img))
print("Little finger up:", detector.little_finger_up(img))
cv2.imshow("Image", img)
if cv2.waitKey(10) == ord('q'):
break

0 comments on commit 67f1679

Please sign in to comment.