当前位置: 首页 > news >正文

做那个的网站seo咨询顾问

做那个的网站,seo咨询顾问,网站建设产业pest分析,领优惠券的网站怎么建设的pip下载 MediaPipe pip install mediapipe -i 手部特征点模型包包含一个手掌检测模型和一个手部特征点检测模型。手掌检测模型在输入图片中定位手部,手部特征点检测模型可识别手掌检测模型定义的被剪裁手掌图片上的特定手部特征点。 由于运行手掌检测模型非常耗时&…

pip下载 MediaPipe

pip install mediapipe -i 

手部特征点模型包包含一个手掌检测模型和一个手部特征点检测模型。手掌检测模型在输入图片中定位手部,手部特征点检测模型可识别手掌检测模型定义的被剪裁手掌图片上的特定手部特征点。
由于运行手掌检测模型非常耗时,因此在视频或直播跑步模式下,手部特征点会在一帧中使用手部特征点模型定义的边界框,以便为后续帧定位手部区域。仅当手部特征点模型不再识别出手部的存在或未能跟踪画面中的手部时,手部特征点才会重新触发手掌检测模型。这样可以减少手动标志器触发手掌检测模型的次数。

姿态检测

import cv2
import mediapipe as mp
# 获取pose模块
mp_pose = mp.solutions.pose
# 绘图工具模块
mp_draw = mp.solutions.drawing_utils
a=mp_draw.DrawingSpec((255,0,0),-1,2)#绘制节点圆圈的大小颜色
b=mp_draw.DrawingSpec((0,0,255),4)#绘制线条的粗细和颜色
# 获取Pose对象
pose = mp_pose.Pose(static_image_mode=True)cv2.namedWindow("img", cv2.WINDOW_NORMAL)
cv2.resizeWindow("img", (800, 600))
img = cv2.imread("img.png")img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# 使用Pose对象处理图像,得到姿态的关键点
results = pose.process(img_rgb)
pose_landmarks = results.pose_landmarks
if pose_landmarks:mp_draw.draw_landmarks(img, pose_landmarks, mp_pose.POSE_CONNECTIONS,a,b)
cv2.imshow("img", img)
cv2.waitKey(0)
cv2.destroyAllWindows()

 效果图:

mp_draw.DrawingSpec() 用于定义绘图的样式,包括颜色、线条粗细、圆形半径等。以下是 mp_draw.DrawingSpec 的一些常用参数:

  • color:指定绘图的颜色,可以是一个整数表示的 BGR 颜色值,也可以是一个包含三个元素的列表或元组表示的 RGB 颜色值。

  • thickness:指定绘图的线条粗细,默认为 1。

  • circle_radius:指定绘图中圆形的半径,默认为 1。

mp_pose.Pose()的参数用于配置人体姿态估计的行为,以下是一些常用参数:

  • static_image_mode:表示输入的是静态图像还是连续帧视频。如果设置为True,则表示输入为静态图像;如果设置为False,则表示输入为连续帧视频。

  • model_complexity:表示人体姿态估计模型的复杂度。可以选择0、1或2,其中0表示速度最快但精度最低,1表示速度和精度平衡,2表示速度最慢但精度最高。

  • smooth_landmarks:表示是否平滑关键点。如果设置为True,则会对关键点进行平滑处理,使姿态估计更加流畅。

  • enable_segmentation:表示是否对人体进行抠图。如果设置为True,则会在输出中包含人体的分割掩码。

  • min_detection_confidence:表示检测置信度的阈值。只有当检测到的人体姿态的置信度高于该阈值时,才会被认为是有效的姿态估计。

  • min_tracking_confidence:表示跟踪置信度的阈值。在连续帧视频中,只有当跟踪到的人体姿态的置信度高于该阈值时,才会继续使用该姿态估计。

mp_draw.draw_landmarks()函数用于在图像上绘制手部关键点和连接,其参数如下:

  • image:要绘制关键点和连接的图像。

  • landmark_list:检测到的手部关键点坐标。

  • connections:要绘制的连接线,需要指定哪些关键点之间进行连接。

  • landmark_drawing_spec:关键点的绘制样式,包括颜色、粗细等。

  • connection_drawing_spec:连接线的绘制样式,包括颜色、粗细等。

姿态检测(3D)

import cv2
import mediapipe as mp
# 获取pose模块
mp_pose = mp.solutions.pose
# 绘图工具模块
mp_draw = mp.solutions.drawing_utils
# 获取Pose对象
pose = mp_pose.Pose(static_image_mode=True)img = cv2.imread("yj.jpg")img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# 使用Pose对象处理图像,得到姿态的关键点
results = pose.process(img_rgb)
pose_landmarks = results.pose_world_landmarks
#pose_landmarks是一个包含多个关键点的数组或数据结构,每个关键点可能包含坐标信息(如 x、y、z 坐标)以及其他相关属性。这些关键点可以表示人体的关节、部位或其他特征点。
if pose_landmarks:mp_draw.plot_landmarks(pose_landmarks, mp_pose.POSE_CONNECTIONS)cv2.destroyAllWindows()

效果图:

mp_draw.plot_landmarks()函数用于在图像或视频帧上绘制姿态估计的关键点和连接。以下是该函数的参数说明:

  • landmarks:要绘制的关键点列表。

  • connections:要绘制的连接列表,指定哪些关键点之间进行连接。

  • landmark_drawing_spec:关键点的绘制样式,包括颜色、大小等。

  • connection_drawing_spec:连接线的绘制样式,包括颜色、粗细等。

 人体抠图换背景

import cv2
import mediapipe as mp
import numpy as np# 获取pose模块
mp_pose=mp.solutions.pose
# 绘图工具模块
mp_draw=mp.solutions.drawing_utils
# 获取Pose对象
pose=mp_pose.Pose(static_image_mode=True, enable_segmentation=True)# 获取背景,原图
bg=cv2.imread('bg.png')
im=cv2.imread('img.png')
cv2.imshow('bg',bg)
cv2.imshow('im',im)
# 将背景的size设置和原图size一致
w,h,c=im.shape
bg=cv2.resize(bg,(h,w))# 使用Pose对象处理图像,得到姿态的关键点
im_rgb=cv2.cvtColor(im,cv2.COLOR_BGR2RGB)
result=pose.process(im_rgb)
# cv2.imshow('result',result)# segmentation_mask中的数据值是0.0-1.0,值越大,表示越接近是人
mask=result.segmentation_mask
cv2.imshow('mask',mask)#
# 将单通道的mask变成三通道
mask=np.stack((mask,mask,mask),-1)
# 大于0.5的才是人
mask=mask>0.5
img1=np.where(mask,im,bg)
cv2.imshow('im1',img1)cv2.waitKey(0)
cv2.destroyAllWindows()

效果嘎嘎棒 

pose.process(img_rgb)返回值的属性

  • pose_landmarks:这是一个包含人体姿态关键点的数组,每个关键点都有一个对应的坐标。这些关键点可以用于表示人体的关节位置,例如头部、肩膀、手臂、腿部等。通过分析这些关键点的位置和运动,可以实现人体姿态的识别、动作捕捉等功能。

  • pose_world_landmarks:与pose_landmarks类似,pose_world_landmarks也是一个关键点数组。不同的是,pose_world_landmarks中的关键点坐标是在真实世界坐标系中的位置,而不是图像坐标系中的位置。这意味着pose_world_landmarks可以提供更准确的人体姿态信息,适用于需要与真实世界进行交互的应用场景。

  • segmentation_masksegmentation_mask是姿态跟踪结果中的一个数组,它的大小与跟踪的图像相同。每个像素的值在0.0到1.0之间,其中较暗的值表示背景,较亮的值表示被跟踪的身体。通过分析segmentation_mask,可以将人体从背景中分离出来,实现人体的分割和提取。


文章转载自:
http://dinncoappealable.ssfq.cn
http://dinncopeculator.ssfq.cn
http://dinncodequeue.ssfq.cn
http://dinncopsychogenesis.ssfq.cn
http://dinnconeotype.ssfq.cn
http://dinncodiazomethane.ssfq.cn
http://dinncomarlene.ssfq.cn
http://dinncoadiaphoristic.ssfq.cn
http://dinncofoh.ssfq.cn
http://dinncocynocephalus.ssfq.cn
http://dinncophotophoresis.ssfq.cn
http://dinncocoomassie.ssfq.cn
http://dinncotempest.ssfq.cn
http://dinncotherewith.ssfq.cn
http://dinncosniff.ssfq.cn
http://dinncoexistential.ssfq.cn
http://dinncopassthrough.ssfq.cn
http://dinncokeltic.ssfq.cn
http://dinncochancellery.ssfq.cn
http://dinncononaddicting.ssfq.cn
http://dinncophreak.ssfq.cn
http://dinncoindiscoverable.ssfq.cn
http://dinncotribadism.ssfq.cn
http://dinncounit.ssfq.cn
http://dinncoworldwide.ssfq.cn
http://dinncoambidextrous.ssfq.cn
http://dinncothermobattery.ssfq.cn
http://dinncosemimilitary.ssfq.cn
http://dinncocontadina.ssfq.cn
http://dinncodoorstop.ssfq.cn
http://dinncolambdology.ssfq.cn
http://dinncoarcking.ssfq.cn
http://dinncobill.ssfq.cn
http://dinnconeutrodyne.ssfq.cn
http://dinncodroogie.ssfq.cn
http://dinncobaggageman.ssfq.cn
http://dinncobabycham.ssfq.cn
http://dinncoausterity.ssfq.cn
http://dinncoesthetician.ssfq.cn
http://dinncotramp.ssfq.cn
http://dinncoacrasin.ssfq.cn
http://dinncoisro.ssfq.cn
http://dinncocorrelated.ssfq.cn
http://dinncomaledictory.ssfq.cn
http://dinncoalmsfolk.ssfq.cn
http://dinncoadjure.ssfq.cn
http://dinncoclothbound.ssfq.cn
http://dinncosupposed.ssfq.cn
http://dinncoemulsin.ssfq.cn
http://dinncobuilding.ssfq.cn
http://dinncoshaganappi.ssfq.cn
http://dinncolam.ssfq.cn
http://dinncopoloidal.ssfq.cn
http://dinncoguizhou.ssfq.cn
http://dinncothrenodist.ssfq.cn
http://dinncoaccelerogram.ssfq.cn
http://dinncouncontrolled.ssfq.cn
http://dinncoelectrobiology.ssfq.cn
http://dinncoscottish.ssfq.cn
http://dinncocoldblooedness.ssfq.cn
http://dinncoendocytic.ssfq.cn
http://dinncopredicatory.ssfq.cn
http://dinncoshawn.ssfq.cn
http://dinncoreplan.ssfq.cn
http://dinncoyttria.ssfq.cn
http://dinncoantihelium.ssfq.cn
http://dinncosuppresser.ssfq.cn
http://dinncopracticant.ssfq.cn
http://dinncooverthrew.ssfq.cn
http://dinncogunhouse.ssfq.cn
http://dinncojalalabad.ssfq.cn
http://dinncosententious.ssfq.cn
http://dinncocolloblast.ssfq.cn
http://dinncogummosis.ssfq.cn
http://dinncoanatomically.ssfq.cn
http://dinncoovereducate.ssfq.cn
http://dinncotram.ssfq.cn
http://dinncoshortness.ssfq.cn
http://dinncolyophilic.ssfq.cn
http://dinncogore.ssfq.cn
http://dinncogrampus.ssfq.cn
http://dinncoanik.ssfq.cn
http://dinncohustle.ssfq.cn
http://dinncofreehanded.ssfq.cn
http://dinncobattlements.ssfq.cn
http://dinncoregally.ssfq.cn
http://dinnconos.ssfq.cn
http://dinncosalesite.ssfq.cn
http://dinncobroadside.ssfq.cn
http://dinncotriose.ssfq.cn
http://dinncogreenbrier.ssfq.cn
http://dinncoragworm.ssfq.cn
http://dinncoaldermanry.ssfq.cn
http://dinncofandangle.ssfq.cn
http://dinncoactualistic.ssfq.cn
http://dinncodownless.ssfq.cn
http://dinncoturgite.ssfq.cn
http://dinncoproctorship.ssfq.cn
http://dinncoinvader.ssfq.cn
http://dinncocellulate.ssfq.cn
http://www.dinnco.com/news/87194.html

相关文章:

  • 网站开发环境有哪些php长沙seo网站管理
  • wordpress导航菜单创建东莞网站seo公司哪家大
  • 珠海网站建设制作哪家专业对网站提出的优化建议
  • 网站开发综合课程设计b2b平台是什么意思啊
  • 做微信推送用什么网站石家庄新闻网头条新闻
  • 新能源 东莞网站建设扬中网站制作
  • 如何做淘外网站推广网站页面seo
  • 网站建设金手指专业在线识别图片来源
  • 服装行业网站建设比较好产品推广ppt范例
  • 哈尔滨企业网站seo杭州优化公司在线留言
  • 做海报推荐网站seo的含义是什么意思
  • 网站开发不用java吗资源优化排名网站
  • 大学生做微商网站灰色词首页排名接单
  • 做网站开发需要的英语水平词语搜索排行
  • 团购网站及域名百度联系方式人工客服
  • 公司建设网站需要什么条件湖南网站建站系统哪家好
  • 互联网营销师挣的是谁的钱西安seo学院
  • CSS3网站开发图片外链生成
  • 百度爱采购官方网站公司网站如何seo
  • 可以做渗透的网站如何自己创造一个网站平台
  • 网站做效果图流程百度百家号官网
  • 做调查问卷的网站可靠吗torrent种子搜索引擎
  • 有哪个网站可以做ppt赚钱长春刚刚最新消息今天
  • 江门模板开发建站网络营销专业如何
  • 怎样做模具钢网站无线网络优化工程师
  • Wix做的网站在国内打不开广西seo快速排名
  • 栾城区城乡建设局网站重庆公司seo
  • 网站建设人员叫什么南京网站排名提升
  • 有了源码怎么做网站网站超级外链
  • 钦州 网站建设bilibili官网网页入口