当前位置:网站首页>Key point detection of human hand based on mediapipe
Key point detection of human hand based on mediapipe
2022-04-23 03:35:00 【Crispy eggplant strips】
MediaPipe It is an open source algorithm framework of Google , Integrated face recognition , Human posture evaluation and hand detection model .
windows Under the MediaPipe install
pip install mediapipe
Be careful :ARM Architecture doesn't have python Under the mediapipe, at present mediapipe Only support x86 framework , I won't support it arm framework , As shown in the figure below .

The code is as follows :
""" Key point detection of hand """
import cv2
import mediapipe as mp
import time
cap = cv2.VideoCapture(0)
mpHands = mp.solutions.hands
hands = mpHands.Hands(static_image_mode=False,
max_num_hands=2,
min_detection_confidence=0.5,
min_tracking_confidence=0.5)
mpDraw = mp.solutions.drawing_utils
pTime = 0
cTime = 0
while True:
success, img = cap.read()
img = cv2.flip(img, 1)
imgRGB = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
results = hands.process(imgRGB)
#print(results.multi_hand_landmarks)
if results.multi_hand_landmarks:
for handLms in results.multi_hand_landmarks:
for id, lm in enumerate(handLms.landmark):
#print(id,lm)
h, w, c = img.shape
cx, cy = int(lm.x *w), int(lm.y*h)
print(cx,cy)
#if id ==0:
cv2.circle(img, (cx,cy), 3, (255,0,255), cv2.FILLED)
mpDraw.draw_landmarks(img, handLms, mpHands.HAND_CONNECTIONS)
cTime = time.time()
fps = 1/(cTime-pTime)
pTime = cTime
cv2.putText(img,str(int(fps)), (10,70), cv2.FONT_HERSHEY_PLAIN, 3, (255,0,255), 3)
cv2.imshow("Image", img)
cv2.waitKey(1)

版权声明
本文为[Crispy eggplant strips]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220602452012.html
边栏推荐
- If statement format flow
- Idempotency practice operation, explaining idempotency based on business
- Codeforces Round #784 (Div. 4)题解 (第一次AK cf (XD
- AWS from entry to actual combat: creating accounts
- Design and implementation of redis (1): understand data structures and objects
- Unity knowledge points (ugui)
- SQL topic exercise summary
- 【微服务】(十)—— 统一网关Gateway
- Three types of cyclic structure
- Common exceptions
猜你喜欢

New ORM framework -- Introduction to beetlsql

MySQL query specifies that a row is sorted to the first row

L3-011 直捣黄龙 (30 分)

JS - accuracy issues

Applet - WXS

2022 group programming ladder game simulation L2-4 Zhezhi game (25 points)

Codeforces Round #784 (Div. 4)题解 (第一次AK cf (XD

QT dynamic translation of Chinese and English languages

Seekbar custom style details

Basic use of Charles
随机推荐
MySQL keyword group_ Concat, combined connection query
Detailed description of MySQL index [B + tree index, hash index, full-text index, overlay index]
Test questions and some space wars
On the principle of concurrent programming and the art of notify / Park
抽象类、接口、常用关键字
Commonly used classes
JS changes the words separated by dashes into camel style
Applet - canvas drawing Poster
Punch in: 4.22 C language chapter - (1) first knowledge of C language - (11) pointer
Un aperçu des flux d'E / s et des opérations de fichiers de classe de fichiers
Scenario Title: how does system a use the page of system B
Code forces round # 784 (DIV. 4) solution (First AK CF (XD)
Mechanical design knowledge point planning
Redis (17) -- redis cache related problem solving
Design and implementation of redis (2): how to handle expired keys
ThreadLocal test multithreaded variable instance
2022 group programming ladder game simulation L2-4 Zhezhi game (25 points)
批量下载文件----压缩后再下载
Unity knowledge points (ugui)
you need to be root to perform this command