finger detection like mp.solutions.hands

8 visualizaciones (últimos 30 días)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar el 16 de Sept. de 2022
Comentada: Ginta Avizonis el 20 de En. de 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 comentario
Ginta Avizonis
Ginta Avizonis el 20 de En. de 2023
Have you had any luck with this? I'm looking for a similar solution...

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by