实时手势识别 【手部跟踪】Mediapipe中的hand
参考链接:
1)github代码链接:https://github.com/google/mediapipe
2)说明文档:https://google.github.io/mediapipe
3)python环境配置文档:https://google.github.io/mediapipe/getting_started/python
4)API简单调用的使用文档:https://google.github.io/mediapipe/solutions/hands#python-solution-api
0.环境准备
python环境配置文档:https://google.github.io/mediapipe/getting_started/python
ubuntu20.04
cuda11.2
python3.8
opencv-python==4.1.2.30
mediapipe==0.8.2
sudo apt install -y protobuf-compiler
sudo apt install -y cmake
1.简介
稍微说明下,文档基本在第一个链接中,python中是通过安装mediapipe的pypi库,调用API来用的。
说明文档:https://google.github.io/mediapipe
import cv2 import mediapipe as mp mp_drawing = mp.solutions.drawing_utils mp_hands = mp.solutions.hands file_list=[] # For static images: hands = mp_hands.Hands(static_image_mode=True,max_num_hands=2,min_detection_confidence=0.5) for idx, file in enumerate(file_list):# Read an image, flip it around y-axis for correct handedness output (see# above).image = cv2.flip(cv2.imread(file), 1)# Convert the BGR image to RGB before processing.results = hands.process(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))# Print handedness and draw hand landmarks on the image.print('Handedness:', results.multi_handedness)if not results.multi_hand_landmarks:continueimage_hight, image_width, _ = image.shapeannotated_image = image.copy()for hand_landmarks in results.multi_hand_landmarks:print('hand_landmarks:', hand_landmarks)print(f'Index finger tip coordinates: (',f'{hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP].x * image_width}, 'f'{hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP].y * image_hight})')mp_drawing.draw_landmarks(annotated_image, hand_landmarks, mp_hands.HAND_CONNECTIONS)cv2.imwrite('/tmp/annotated_image' + str(idx) + '.png', cv2.flip(annotated_image, 1)) hands.close()# For webcam input: hands = mp_hands.Hands(min_detection_confidence=0.5, min_tracking_confidence=0.5) cap = cv2.VideoCapture(0) while cap.isOpened():success, image = cap.read()if not success:print("Ignoring empty camera frame.")# If loading a video, use 'break' instead of 'continue'.continue# Flip the image horizontally for a later selfie-view display, and convert# the BGR image to RGB.image = cv2.cvtColor(cv2.flip(image, 1), cv2.COLOR_BGR2RGB)# To improve performance, optionally mark the image as not writeable to# pass by reference.image.flags.writeable = Falseresults = hands.process(image)# Draw the hand annotations on the image.image.flags.writeable = Trueimage = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)if results.multi_hand_landmarks:for hand_landmarks in results.multi_hand_landmarks:mp_drawing.draw_landmarks(image, hand_landmarks, mp_hands.HAND_CONNECTIONS)cv2.imshow('Hands', image)if cv2.waitKey(5) & 0xFF == 27:break hands.close() cap.release()
基于Openpose改进的Python纯CPU深度学习实时识别手势和检测手指关节点
实时手势识别 【手部跟踪】Mediapipe中的hand相关推荐
- 谷歌开源基于 ML 的手部跟踪算法
朋友们,如需转载请标明出处:http://blog.csdn.net/jiangjunshow 就在不久前,Google 人工智能实验室宣布,他们在「实时手部跟踪」方面取得了新的进展,并将这项新技术运 ...
- 基于OpenCV的简易实时手势识别(含代码)
基于OpenCV的简易实时手势识别 1.基本信息介绍 1.1实验步骤 1.2效果展示 2.肤色检测+二值化+开运算+高斯模糊 2.1 flip()函数原型 2.2cvtColor()函数原型 2.3s ...
- 隔空作画,握拳清屏,这个手部跟踪项目火了,在线可玩
在屏幕上隔空作画是近来新兴的一种有趣应用,其中涉及复杂的手部跟踪技术,这类技术成熟之后可用于提升应用程序的交互体验.此前机器之心曾报道过可以隔空写字.绘图的有趣项目「air-drawing」,该项目利 ...
- 谈谈NiTE 2手部跟踪在彩色图像上的显示
主要内容: NiTE2手部跟踪流程 代码演示 总结 一.NiTE2手部跟踪流程 我自己都感觉到天天在重复着相同的代码,但我觉得没什么不好的,对于新东西的学习只有在重复再重复的过程中,才能积累经验,较少 ...
- 不同实验样品在实时荧光定量PCR检测中要求有哪些?
实时荧光定量PCR被常用于检测生物样品,同时也是检测DNA.RNA含量的最普遍的方法,通过荧光染料或荧光标记的特异性的探针,对PCR产物进行标记跟踪,实时在线监控反应过程,结合相应软件可以对产物进行分 ...
- 使用卡尔曼滤波实现单目标跟踪过程中的目标运动轨迹预测
针对目标被遮挡的情况,使用卡尔曼滤波进行轨迹预测,试验表明,具有较好的轨迹预测效果 观测值:传感器读数,因为某些客观原因,可能存在较大误差. 估计值:也称为先验估计,卡尔曼滤波的状态转移方程进行估计. ...
- Cesium实时目标跟踪最新特效教程系列2—粒子系统(实时发射波束跟踪目标)
cesium粒子特效 实时跟踪目标发射波束, sourEntity 实时发射波束跟踪 tarEntity,官网上给出的demo是随机发射粒子,没有跟踪目标.下面给出了怎样实时发射波束且跟踪目标的.最主 ...
- 使用Python,OpenCV的Meanshift 和 Camshift 算法来查找和跟踪视频中的对象
使用Python,OpenCV的Meanshift 和 Camshift 算法来查找和跟踪视频中的对象 1. 效果图 2. 源码 2.1 MeanShift 2.2 Camshift(Continuo ...
- 超酷的实时颜色数据跟踪javascript类库 - Tracking.js
来源:GBin1.com 今天介绍这款超棒的Javascript类库是 - Tracking.js,它能够独立不依赖第三方类库帮助开发人员动态跟踪摄像头输出相关数据. 这些数据包括了颜色或者是人, 这 ...
- CV之API:利用Face++的人体识别接口,实现摄像头实时手势识别
CV之API:利用Face++的人体识别接口,实现摄像头实时手势识别 目录 测试图片 实现代码(部分) 测试图片 实现代码(部分) #利用Face++的人体识别接口,实现摄像头实时手势识别 impor ...
最新文章
- 暂缓上市!小马智行SPAC赴美上市计划推迟,自驾IPO路漫漫
- MATLAB1770太阳黑子,基于MATLAB的太阳黑子时间序列与仿真
- node开启子线程_多进程 amp; Node.js web 实现
- Apache Spark 的设计与实现(job逻辑执行图)
- ubuntu按方向键出现abcd_Ubuntu Vi方向键[A [B [C [D问题解决
- No fallback instance of type class found for feign client user-service(转)
- 第八节:SpringBoot指定配置文件配置三
- 《阿里巴巴中国总裁叶朋:B2B从1.0向2.0的升级》阅读整理
- 【PS】免费 使用PS批量将pdf转换成图片 pdf转图片 pdf转jpg pdf转png
- SI9000阻抗计算教程
- UE编辑器加入鼠标右键
- cocos2d js 别出白线游戏上线
- Linux安装配置FTP(pure-ftpd)
- python可变数据类型和不可变数据类型
- 所有人体胸部和下半身各部位的英语单词
- 户型平面原型设计-简介
- 浏览器源代码下载图片原图,手把手教学
- Java MyShopping管理系统 > 购物结算+管理系统
- 某徒步旅游网站python爬虫小练习
- 米兔机器人魔方_米兔卡片学习机首晒
热门文章
- SQL查询语句 group by后, 字符串合并
- 非结构化数据与结构化数据提取---- BeautifulSoup4 解析器
- 初始化bean(二)—— 缓存部分
- destoon b2b 360网站智能摘要标签配置
- 异常:fatal: unable to access 'https://git.oschina.net/pcmpcs/library.git/': Could not resolve host...
- Java并发编程之线程池ThreadPoolExecutor解析
- win10升级后chrome碰到对话框就卡死
- Linux 文件夹权限
- 查看进程占用,并kill掉
- java线程和操作系统线程_操作系统中的线程