Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Handtracking
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#import the libraries
import cv2
import mediapipe as mp
mp_drawing=mp.solutions.drawing_utils
mp_drawing_styles=mp.solutions.drawing_styles
mphands=mp.solutions.hands

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the structure of the repository: Repository > Sub-Repository (for your project) > your code.

I also see that the file doesn't have an extension. Please make it a python file.

cap=cv2.VideoCapture(0)
hands=mphands.Hands()
while True:
data,image=cap.read()
image=cv2.cvtColor(cv2.flip(image,1),cv2.COLOR_BGR2RGB)
results=hands.process(image)
image=cv2.cvtColor(image,cv2.COLOR_RGB2BGR)
if results.multi_hand_landmarks:
for hand_landmarks in results.multi_hand_landmarks:
mp_drawing.draw_landmarks(
image,
hand_landmarks,mphands.HAND_CONNECTIONS)
cv2.imshow("Handtracker",image)
cv2.waitkey(1)