필터 지우기
필터 지우기

finger detection like mp.solutions.hands

조회 수: 8 (최근 30일)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar 2022년 9월 16일
댓글: Ginta Avizonis 2023년 1월 20일
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
Ginta Avizonis
Ginta Avizonis 2023년 1월 20일
Have you had any luck with this? I'm looking for a similar solution...

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by