Skip to content

Commit

Permalink
modify README
Browse files Browse the repository at this point in the history
  • Loading branch information
andy6804tw committed Apr 12, 2024
1 parent bf18700 commit 15d2c25
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@

## MediaPipe Pose

| Origin | Pose landmark |
|--------|---------------|
| ![](./image/test1.png) | ![](./screenshot/output.jpg) |

<iframe
src="https://1010code.github.io/pose-landmarks-detection/screenshot/output.html"
style="width:100%; height:300px;"
></iframe>
| Origin | Pose landmark | 3D landmarks |
|--------|---------------|---------------|
| ![](./image/test1.png) | ![](./screenshot/output.jpg) |![](./screenshot/output3d.png)|

[![Demo CountPages alpha](https://share.gifyoutube.com/KzB6Gb.gif)](https://www.youtube.com/watch?v=ek1j272iAmc)

## OpenPose
- Body25
Expand Down
6 changes: 3 additions & 3 deletions mediapipe-cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def angle_btn_3points(p1,p2,p3):
mp_pose = mp.solutions.pose # mediapipe 姿勢偵測

# cap = cv2.VideoCapture(0)
cap = cv2.VideoCapture('./video/upstair.mp4')
cap = cv2.VideoCapture('./video/walk1.mp4')

# 取得原始影片的 FPS
original_fps = cap.get(cv2.CAP_PROP_FPS)
Expand Down Expand Up @@ -65,8 +65,8 @@ def angle_btn_3points(p1,p2,p3):
p2 = [landmarks[kp.RIGHT_KNEE.value].x,landmarks[kp.RIGHT_KNEE.value].y]
p3 = [landmarks[kp.RIGHT_ANKLE.value].x,landmarks[kp.RIGHT_ANKLE.value].y]
DR = angle_btn_3points(p1, p2, p3)
cv2.putText(img, f'{int(DL)}', (int(landmarks[kp.LEFT_KNEE.value].x*frame_width),int(landmarks[kp.LEFT_KNEE.value].y*frame_height)), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (0, 0, 255), 1, lineType=cv2.LINE_AA)
cv2.putText(img, f'{int(DR)}', (int(landmarks[kp.RIGHT_KNEE.value].x*frame_width),int(landmarks[kp.RIGHT_KNEE.value].y*frame_height)), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (0, 0, 255), 1, lineType=cv2.LINE_AA)
# cv2.putText(img, f'{int(DL)}', (int(landmarks[kp.LEFT_KNEE.value].x*frame_width),int(landmarks[kp.LEFT_KNEE.value].y*frame_height)), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (0, 0, 255), 1, lineType=cv2.LINE_AA)
# cv2.putText(img, f'{int(DR)}', (int(landmarks[kp.RIGHT_KNEE.value].x*frame_width),int(landmarks[kp.RIGHT_KNEE.value].y*frame_height)), cv2.FONT_HERSHEY_SIMPLEX, 0.4, (0, 0, 255), 1, lineType=cv2.LINE_AA)
##################
out.write(img) # 將畫面寫入 VideoWriter
cv2.imshow('Preview', img)
Expand Down
Binary file modified screenshot/output.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/output3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshot/walk1.mp4
Binary file not shown.

0 comments on commit 15d2c25

Please sign in to comment.