Skip to content

humoyun-dev/hand-draw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hand Gesture Drawing Board

A computer vision-based drawing application controlled by hand gestures. Built with Python, Tkinter, OpenCV, and MediaPipe.

Features

  • Hand Tracking: Real-time hand detection using MediaPipe.
  • Gestures:
    • Pinch (Index + Thumb): Draw or create shapes.
    • Fist: Eraser (overrides all tools).
  • Tools:
    • Pen: Freehand drawing (smooth strokes).
    • Shapes: Line, Rectangle, Circle (with live preview).
  • Controls:
    • Brush Size, Eraser Size, Shape Width.
    • Color Picker (Presets + Custom).
    • Undo / Redo / Clear.
    • Save to PNG.
  • UI:
    • Live Camera Preview.
    • Status Bar (FPS, Hand State).

Prerequisites

  • macOS (Apple Silicon recommended for performance) or any OS with Python support.
  • Webcam.
  • Python 3.11.

Installation

  1. Create a Virtual Environment:

    python3.11 -m venv .venv
    source .venv/bin/activate
  2. Install Dependencies:

    pip install -r requirements.txt

Usage

  1. Run the Application:

    python main.py
  2. Permissions (macOS):

    • The first time you run it, macOS will ask for Camera permissions for your Terminal/IDE. Allow it.
  3. How to Draw:

    • Move Cursor: Move your hand. The cursor follows your index fingertip.
    • Draw: Pinch your thumb and index finger together. Hold the pinch to draw. Release to stop.
    • Shapes: Select a shape tool (Line/Rect/Circle). Pinch to set start point, drag to size, release to commit.
    • Erase: Make a Fist. The cursor turns into an eraser. Rub over drawings to erase.

Troubleshooting

  • Camera not opening: Ensure no other app is using the camera. Check terminal permissions in System Settings > Privacy & Security > Camera.
  • Jittery Cursor: Adjust lighting. Ensure hand is clearly visible. The app includes smoothing, but extreme lighting conditions can affect tracking.

About

A computer vision-based drawing application controlled by hand gestures. Built with Python, Tkinter, OpenCV, and MediaPipe.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages