首页 > 编程知识 正文

AI视频动作捕捉跟踪,opencvsharp视频教程

时间:2023-05-04 21:52:50 阅读:166823 作者:3359

直接查看代码:

import c v2 importmathimporttimeimportmediapipeasmpfromosimportlistdirmp _ drawing=MP.solutions.drawing _ utils MP _ hand 此函数可以识别手的hands=MP _ hands.hands (min _ detection _ confidence=0.5 )。 min _ tracking _ confidence=0.5 (cap=cv2.video capture (0) while cap.isOpened ) ) : success, image=cap.read (if not success 3360 print )“无图像”(continueimage=cv2.cvtcolor ) cv2.flip ) image,1 ),cv2.color 通过results.multi_hand_landmarks访问results=hands.process(image ) image.flags.writeable=true image=cv2.cvtcc landmarks:#得到results.multi_hand_landmarks中的一点坐标,for hand _ landmarksinresults.multi _ hand _ landmarks 要在其中绘制hand_Landmarks的MP _ hands.hand _ connections (cv2.im show ) ' result ',image ) ifcv2.waitkey(5)0x ff

结果:

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。