Skip to content

Commit 3e9afd1

Browse files
committed
update
1 parent 5220241 commit 3e9afd1

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

Chapter 1 Hand Tracking/Basics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# cv2.__version__ = 4.10.0, mp.__version__ = 0.10.14
2-
31
import cv2
42
import mediapipe as mp
53
import time

Chapter 1 Hand Tracking/HandTrackingModule.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# cv2.__version__ = 4.10.0, mp.__version__ = 0.10.14
2-
31
import cv2
42
import mediapipe as mp
53
import time
Binary file not shown.

Chapter 2 Pose Estimation/Basics.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import time
44

55
# 初始化 Mediapipe 的绘图工具和姿势检测模块
6-
mpDraw = mp.solutions.drawing_utils
7-
mpPose = mp.solutions.pose
8-
pose = mpPose.Pose()
6+
mpDraw = mp.solutions.drawing_utils # 导入 MediaPipe 的绘图工具,用于在图像上绘制检测到的姿势连接和关键点
7+
mpPose = mp.solutions.pose # 导入 MediaPipe 的姿势估计模块
8+
pose = mpPose.Pose() # 创建一个姿势检测对象,用于处理图像并检测人体姿势
99

1010
# 打开视频文件
1111
cap = cv2.VideoCapture("E:\\Advance Computer Vision with Python\\Chapter 2 Pose Estimation\\PoseVideos\\3.mp4")
@@ -37,9 +37,7 @@
3737
for id, lm in enumerate(results.pose_landmarks.landmark):
3838
h, w, c = img.shape # 获取图像尺寸
3939
cx, cy = int(lm.x * w), int(lm.y * h) # 计算关键点在图像中的位置
40-
cv2.circle(
41-
img, (cx, cy), 5, (255, 0, 0), cv2.FILLED
42-
) # 在关键点位置绘制圆圈
40+
cv2.circle(img, (cx, cy), 5, (255, 0, 0), cv2.FILLED)# 在关键点位置绘制圆圈
4341

4442
cTime = time.time()
4543
fps = 1 / (cTime - pTime) # 计算帧率
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# mp.solutions.pose
2+
3+
`mpPose = mp.solutions.pose` 导入 MediaPipe 的姿势估计模块
4+
5+
`pose = mpPose.Pose()` 创建一个姿势检测对象,用于处理图像并检测人体姿势
6+
7+
`results = pose.process(imgRGB)` 处理图像,检测姿势

Chapter 2 Pose Estimation/tempCodeRunnerFile.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)