How lancercrack25/fingers-hand-detector works
Project type and purpose
• This is a standalone real-time computer vision application written in Python.
• Its goal is to capture live video, detect hands and fingers (using MediaPipe Hands), count and identify which fingers are raised, recognize basic hand gestures, and overlay results on the video.
File structure
• Top level:
• README.md – project overview, libraries, usage
• program.py – core application script
• Results/… – sample output videos
• There are no distinct frontend/backend modules or microservices—everything runs inside one Python process.
README for additional insights
• Libraries: OpenCV (cv2) for capture and image processing, MediaPipe for the hand-landmarks model, NumPy/math for calculations.
• Workflow described: capture → landmark detection → finger state calculation → gesture classification → display.
Main components
a. Video Input
• Hardware camera or video feed
• Captured via cv2.VideoCapture
b. Preprocessing Module
c. MediaPipe Hands Model
• Pretrained ML model loaded via mediapipe.solutions.hands
• Outputs 21 hand landmarks per detected hand
d. Landmark Processor
• Receives raw landmarks
• Applies geometric rules (using NumPy/math) to determine which fingers are up
e. Gesture Recognizer
• Maps combinations of raised fingers to named gestures (paz, puño, dedo grosero, mano abierta)
f. Output Renderer
• Draws landmarks, counts, labels on frames via OpenCV drawing functions
• Displays or records video stream (Results/ folder)
Relationships and data flow
• Preprocessing → MediaPipe Hands Model
• Model → Landmark Processor
• Landmark Processor → Gesture Recognizer
• Gesture Recognizer → Output Renderer
• Output Renderer → Display/Save
Architectural pattern & principles
• Pipeline (stream processing) pattern: linear stages that process each video frame in sequence.
• Single-process, modular stages for clarity and easy debugging.
• Separation of concerns: capture, ML inference, post-processing, and rendering are distinct.
Detail level
• Six pipeline stages above.
• Do not break down individual OpenCV or NumPy calls further—group them into logical modules.