-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
60 lines (57 loc) · 3.33 KB
/
Copy pathindex.html
File metadata and controls
60 lines (57 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hand Gesture Recognition with p5.js</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.7.0/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/camera_utils/camera_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/control_utils/control_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/drawing_utils/drawing_utils.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands/hands.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<div class="info">
<h1>Multi-Hand Gesture Recognition</h1>
<p>No Gesture</p>
<p>Try these gestures with one or both hands: Pinch, Fist, Open Hand, Pointing, Victory</p>
<div style="font-size: 12px; margin-top: 10px; opacity: 0.8;">
<strong>Multi-Hand Support:</strong><br>
• Left hand: Green landmarks<br>
• Right hand: Blue landmarks<br>
• Both hands tracked simultaneously<br>
• Individual gesture detection per hand
</div>
<div style="font-size: 12px; margin-top: 10px; opacity: 0.8;">
<strong>Gesture Guide:</strong><br>
• Pinch: Grab objects<br>
• Fist: Closed hand<br>
• Open Hand: All fingers extended<br>
• Pointing: Index finger only<br>
• Victory: Index + middle fingers
</div>
<div id="open-hand-indicator" style="display: none; margin-top: 20px; padding: 15px; background: rgba(0, 255, 0, 0.2); border: 2px solid #00ff00; border-radius: 10px; text-align: center;">
<h3 style="color: #00ff00; margin: 0;">🖐️ OPEN HAND DETECTED! 🖐️</h3>
<p style="color: #00ff00; margin: 5px 0 0 0; font-size: 14px;">All fingers extended</p>
</div>
</div>
<div class="video-container">
<video class="input_video" autoplay muted playsinline></video>
<div id="camera-status" style="color: white; margin-top: 10px;">Camera: Waiting for permission...</div>
<button id="enable-camera" style="margin-top: 10px; padding: 10px 20px; background: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 16px;">Allow Camera Access (Privacy Mode)</button>
<div id="camera-help" style="color: #ffd700; margin-top: 10px; font-size: 14px; display: none;">
If camera doesn't work, check your browser's camera permissions or try refreshing the page.
</div>
<div style="color: #90EE90; margin-top: 10px; font-size: 12px; opacity: 0.8;">
<strong>Privacy Mode:</strong> Only hand landmarks are processed. No video is stored or displayed.
</div>
</div>
<div class="canvas-container" id="canvas-container">
<!-- p5.js canvas will be inserted here -->
</div>
</div>
<script src="sketch.js"></script>
</body>
</html>