Skip to content

Commit 3801945

Browse files
committed
Merge remote-tracking branch 'origin/develop' into feat/#46
2 parents b784c42 + 53cdd49 commit 3801945

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

src/components/Posture/GuidePopup/SnapshotGuide.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ export default function SnapshotGuide() {
2020
<span className="flex h-6 w-6 justify-center rounded-full bg-[#5A9CFF] text-center font-semibold text-white">
2121
1
2222
</span>
23-
<span className="font-[20px] font-semibold text-green-900">머리와 목을 일직선으로 곧게 펴기</span>
23+
<span className="font-[20px] font-semibold text-zinc-800">머리와 목을 일직선으로 곧게 펴기</span>
2424
</div>
2525
<div className="flex gap-3">
2626
<span className="flex h-6 w-6 justify-center rounded-full bg-[#5A9CFF] text-center font-semibold text-white">
2727
2
2828
</span>
29-
<span className="font-[20px] font-semibold text-green-900">양쪽 어깨 일직선 유지하기</span>
29+
<span className="font-[20px] font-semibold text-zinc-800">양쪽 어깨 일직선 유지하기</span>
3030
</div>
3131
<div className="flex gap-3">
3232
<span className="flex h-6 w-6 justify-center rounded-full bg-[#5A9CFF] text-center font-semibold text-white">
3333
3
3434
</span>
35-
<span className="font-[20px] font-semibold text-green-900">팔은 책상 위에 수평으로 두기</span>
35+
<span className="font-[20px] font-semibold text-zinc-800">팔은 책상 위에 수평으로 두기</span>
3636
</div>
3737
<div className="flex gap-3">
3838
<span className="flex h-6 w-6 justify-center rounded-full bg-[#5A9CFF] text-center font-semibold text-white">
3939
4
4040
</span>
41-
<span className="font-[20px] font-semibold text-green-900">등과 허리는 등받이에 지지하기</span>
41+
<span className="font-[20px] font-semibold text-zinc-800">등과 허리는 등받이에 지지하기</span>
4242
</div>
4343
</div>
4444
</div>

src/utils/drawer.ts

+15-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const drawPose = (poses: pose[], canvas: HTMLCanvasElement, isRight = tru
1010
const leftShoulder = pose.keypoints.find((kp) => kp.name === "left_shoulder")
1111
const rightShoulder = pose.keypoints.find((kp) => kp.name === "right_shoulder")
1212
const color = isRight ? "#00C670" : "#EF4444"
13+
1314
// 왼쪽과 오른쪽 어깨 이어주는 선 그리기
1415
if (leftShoulder && rightShoulder && leftShoulder.confidence > 0.2 && rightShoulder.confidence > 0.2) {
1516
ctx.beginPath()
@@ -20,15 +21,25 @@ export const drawPose = (poses: pose[], canvas: HTMLCanvasElement, isRight = tru
2021
ctx.stroke()
2122
}
2223

24+
// 특정 부위에만 원 그리기 (양쪽 손목 추가)
25+
const targetParts = [
26+
"left_ear",
27+
"right_ear",
28+
"left_shoulder",
29+
"right_shoulder",
30+
"nose",
31+
"left_wrist",
32+
"right_wrist",
33+
]
2334
pose.keypoints.forEach((keypoint) => {
24-
if (keypoint.confidence > 0.25) {
35+
if (keypoint.confidence > 0.25 && targetParts.includes(keypoint.name)) {
2536
ctx.beginPath()
2637
ctx.arc(keypoint.x, keypoint.y, 5, 0, 2 * Math.PI)
2738
ctx.fillStyle = "white"
2839
ctx.fill()
29-
ctx.strokeStyle = color // 초록색 테두리
30-
ctx.lineWidth = 2 // 테두리 두께
31-
ctx.stroke() // 테
40+
ctx.strokeStyle = color
41+
ctx.lineWidth = 2
42+
ctx.stroke()
3243
}
3344
})
3445
})

0 commit comments

Comments
 (0)