finger detection like mp.solutions.hands

23 Ansichten (letzte 30 Tage)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar am 16 Sep. 2022
Kommentiert: Ginta Avizonis am 20 Jan. 2023
I wish MATLAB had a similar function for quick and accurate finger recognition.
I did not find anything.
If anyone knows a method like this, please let me know
import cv2
import mediapipe as mp
cap = cv2.VideoCapture(0)
mediapipeHands = mp.solutions.hands
hands = mediapipeHands.Hands()
Draw = mp.solutions.drawing_utils
blue= (0,0 ,255)
while True:
_, frame = cap.read()
cv2.imshow('webcam', frame)
cv2.waitKey(1)
frameRGB = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
results = hands.process(frameRGB)
if results.multi_hand_landmarks:
for handlandmarks in results.multi_hand_landmarks:
for Id, lm in enumerate(handlandmarks.landmark):
h, w, c = frame.shape
x, y = int(lm.x * w), int(lm.y * h)
if Id == 4:
print(Id, x, y)
cv2.circle(frame, (x, y), 15, (0, 255, 0), -1)
Draw.draw_landmarks(frame, handlandmarks, mediapipeHands.HAND_CONNECTIONS)
cv2.imshow('webcam', frame)
cv2.waitKey(1)
  1 Kommentar
Ginta Avizonis
Ginta Avizonis am 20 Jan. 2023
Have you had any luck with this? I'm looking for a similar solution...

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by