Skip to content

Nothing-dot-exe/Basic-painting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🎨 AI Hand Painter — Draw with Your Hand! 🖐️🖌️

A fun and interactive real-time hand drawing app built using OpenCV, NumPy, and MediaPipe.
Move your index finger in the air to draw — no mouse required! 🚀


🚀 Features

  • 🖐️ Draw using your hand — Detects index finger and draws in real-time.
  • 🎨 Dynamic canvas — Canvas automatically matches your webcam resolution.
  • ♻️ Clear the canvas — Press C anytime to clear your drawings.
  • Exit easily — Press Q to quit.
  • 🧠 Intelligent finger tracking powered by MediaPipe Hands.

📂 Project File

  • ai_hand_painter.py — main script that runs the AI hand drawing app.

🧰 Requirements

Make sure you have the following Python libraries installed:

pip install opencv-python mediapipe numpy

💡 If installation fails, try upgrading pip:

pip install --upgrade pip

▶️ How to Run

  1. Connect your webcam.
  2. Open a terminal or VS Code terminal in your project folder.
  3. Run the script:
python ai_hand_painter.py
  1. Controls:
    • 🧽 Press C → Clear the canvas
    • 🚪 Press Q → Quit the program

🧩 How It Works

  1. Webcam Feed: Captures video using OpenCV.
  2. Hand Detection: MediaPipe detects 21 hand landmarks.
  3. Finger Tracking: Detects which fingers are up using custom logic.
  4. Drawing Mode:
    • If only the index finger is up, it draws on the canvas.
    • If multiple fingers are up, drawing stops.
  5. Canvas Merge: Blends live camera feed with your drawn strokes using cv2.addWeighted().

✨ Future Enhancements

  • 🖍️ Color palette for multiple pen colors
  • 🧽 Eraser mode
  • 📸 Save drawing as image file
  • 🔊 Add voice commands for color and size control
  • 🖼️ GUI interface with brush size slider

⚠️ Troubleshooting

  • "Cannot access camera":
    Make sure your webcam is not used by another app.
  • ⚠️ "Camera read failed":
    Try restarting your computer or checking permissions.
  • 🧱 mediapipe not found:
    Reinstall mediapipe using pip install mediapipe.

🧠 Credits

Built using:


📜 License

MIT License © 2025 — Feel free to use, modify, and share! 💚


❤️ Author

Amit KadamAI & Python Enthusiast
📧 kadamamit462@gmail.com
🌐 GitHub: @piyushkadam96k


🧠 "Where AI meets creativity — One hand at a time."

About

Paint on a virtual canvas using your index finger. Built with OpenCV + MediaPipe. Simple, fun, and great for demos or classroom projects!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages