当前位置:网站首页>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
边栏推荐
- Romantic silhouette of L2-3 of 2022 group programming ladder Simulation Competition (25 points)
- Query stored procedures in PostgreSQL
- QT dynamic translation of Chinese and English languages
- Optimization of especially slow startup in idea debugging mode
- Detailed description of MySQL index [B + tree index, hash index, full-text index, overlay index]
- Visual programming - Experiment 1
- Applet - WXS
- Websites frequented by old programmers (continuously updated)
- QT learning summary
- The art of concurrent programming (2): synchronized usage scenarios
猜你喜欢
C abstract class
Supersocket is Used in net5 - command
Use of rotary selector wheelpicker
Explanation keyword of MySQL
PyMOL usage
Super easy to use asynchronous export function of Excel
Translation of l1-7 matrix columns in 2022 group programming ladder Simulation Competition (20 points)
Design and implementation of redis (3): persistence strategy RDB, AOF
Codeforces Round #784 (Div. 4)題解 (第一次AK cf (XD
抽象类、接口、常用关键字
随机推荐
The art of concurrent programming (5): the use of reentrantlock
Docker pulls MySQL and connects
Database SQL -- simulate inserting a large amount of data, importing / exporting database scripts, timestamp conversion and database basics
C set
Create virtual machine
Problem a: face recognition
集合之List接口
Design and implementation of redis (1): understand data structures and objects
SQL learning record
Concepts of objects and classes
L3-011 direct attack Huanglong (30 points)
批量下載文件----壓縮後再下載
Code forces round # 784 (DIV. 4) solution (First AK CF (XD)
Design and implementation of redis (5): master-slave replication strategy and optimization
mui. Plusready does not take effect
PyMOL usage
[microservices] (x) -- Unified gateway
【微服务】(十)—— 统一网关Gateway
MySQL zip installation tutorial
MySQL is completely uninstalled and MySQL service is cleaned up