How d4min/aircanvas works
Project Type & Purpose
• AirCanvas is a computer vision application that turns a webcam into a drawing canvas using hand gestures.
• Its key functions are capturing video frames, detecting hand landmarks to infer gestures, mapping gestures to drawing actions, and rendering a digital canvas.
Analyzing the File Structure
• The core project files are housed in the “src” directory:
• config.py: Likely handles configuration settings for the app (e.g., camera parameters, drawing configurations).
• hand_tracker.py: Implements real-time hand tracking using MediaPipe.
• gesture.py: Contains logic to interpret hand movements/gestures into drawing commands.
• drawing.py: Handles the actual drawing on a virtual canvas by interfacing with OpenCV.
• main.py: Serves as the entry point, orchestrating the interaction between modules.
• Other files such as requirements.txt and README.md help with environment setup and documentation.
Key Components to Highlight
a. Webcam/Capture Device: The starting point where video frames are captured.
b. Hand Tracking Module (hand_tracker.py):
• Uses MediaPipe to detect hand landmarks and track movement.
• Feeds landmark or coordinate data to the Gesture Module.
c. Gesture Recognition Module (gesture.py):
• Maps detected gestures to drawing instructions.
d. Drawing & Image Processing Module (drawing.py):
• Uses OpenCV to render the drawings