Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

code hand tracking

#you must install mediapipe and cv2
#INSTALL MEDIAPIPE
  #click search bar then write "cmd"and right click then click run as administrator
  #copy then paste:pip install mediapipe
#INSTALL CV2
  #copy then paste:pip install opencv-python

#If you don't know how to install,sigh and comment your question :)

from unittest import result
import cv2
import mediapipe as mp
import time

cap = cv2.VideoCapture(0)

mpHand = mp.solutions.hands
hands = mpHand.Hands()
mpdraw = mp.solutions.drawing_utils

while True:
    success, img = cap.read()
    imgRBG = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
    results = hands.process(imgRBG)
    #print(results.multi_hand_landmarks)
    if results.multi_hand_landmarks:
        for handlms in results.multi_hand_landmarks:
            mpdraw.draw_landmarks(img,handlms,mpHand.HAND_CONNECTIONS)

    cv2.imshow("normal", img)
    cv2.waitKey(1)
Comment

PREVIOUS NEXT
Code Example
Python :: python detect keypress 
Python :: pandas dataframe column rename 
Python :: extract zip file python 
Python :: mape python 
Python :: equivalent of ament_index_python in noetic 
Python :: Square of numbers in non-decreasing order 
Python :: python how often character ins tring 
Python :: how to provide default value when assign i ngvariables python 
Python :: how to print the text of varying length in python 
Python :: how to make a multichoice in python 
Python :: django check if url safe 
Python :: matplotlib random color 
Python :: flask app starter 
Python :: grid search python 
Python :: pyinstaller for spacy code 
Python :: copy file in python3 
Python :: override the text in buttons django admin 
Python :: assert len(lex) < self.bucket_specs[-1][1] 
Python :: df reanme columns 
Python :: print console sys.stdout 
Python :: Python program that takes 2 words as input from the user and prints out a list containing the letters that the 2 words have in common 
Python :: how to return only fractional part in python 
Python :: knn plot the clusters 
Python :: pil save image 
Python :: flask docker 
Python :: python date now plus days 
Python :: python psycopg2 utf8 
Python :: get wav file in dir 
Python :: get all indices of a value in list python 
Python :: serializers.py include all fields 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =