Draw modern status panel
(self, img, gesture, fps)
| 100 | cv2.putText(img, f'{int(value)}%', (x + 155, y_pos + 8), cv2.FONT_HERSHEY_SIMPLEX, 0.4, color, 1) |
| 101 | |
| 102 | def draw_status_panel(self, img, gesture, fps): |
| 103 | """Draw modern status panel""" |
| 104 | panel_height = 80 |
| 105 | panel_width = 300 |
| 106 | x, y = 10, 10 |
| 107 | |
| 108 | # Semi-transparent background |
| 109 | overlay = img.copy() |
| 110 | cv2.rectangle(overlay, (x, y), (x + panel_width, y + panel_height), (20, 20, 20), -1) |
| 111 | cv2.addWeighted(overlay, 0.7, img, 0.3, 0, img) |
| 112 | |
| 113 | # Border |
| 114 | cv2.rectangle(img, (x, y), (x + panel_width, y + panel_height), NEON_BLUE, 2) |
| 115 | |
| 116 | # Content |
| 117 | cv2.putText(img, 'HAND TRACKING AR', (x + 10, y + 25), cv2.FONT_HERSHEY_SIMPLEX, 0.6, WHITE, 2) |
| 118 | cv2.putText(img, f'Gesture: {gesture}', (x + 10, y + 45), cv2.FONT_HERSHEY_SIMPLEX, 0.5, NEON_CYAN, 1) |
| 119 | cv2.putText(img, f'FPS: {fps}', (x + 10, y + 65), cv2.FONT_HERSHEY_SIMPLEX, 0.4, ACCENT_GREEN, 1) |
| 120 | |
| 121 | # Timestamp |
| 122 | time_str = datetime.now().strftime('%H:%M:%S') |
| 123 | cv2.putText(img, time_str, (x + 200, y + 65), cv2.FONT_HERSHEY_SIMPLEX, 0.4, WHITE, 1) |
| 124 | |
| 125 | def draw_open_hand_ui(self, img, palm, fingertips, angle): |
| 126 | """Modern open hand UI""" |