This Python project demonstrates hand gesture recognition and a simple drawing application using OpenCV and the MediaPipe library. The application allows users to draw on the screen by tracking hand movements and recognizing specific gestures.
- Detects hand landmarks in real-time.
- Identifies the positions of fingers for gesture recognition.
- Recognizes specific hand gestures to switch between different drawing modes.
- Enables users to draw on the screen using different colors and eraser functionalities.
- Offers a variety of color options available through hand gesture recognition.
- Allows switching between drawing and selection modes using hand gestures.
Contains a Python module (handTrackingModule
) that defines a HandDetector
class for hand tracking and gesture recognition. The class uses the MediaPipe library for detecting hand landmarks, identifying finger positions, and recognizing gestures.
The VirtualPainter.py
script integrates the HandDetector
class to create a real-time drawing application. It utilizes the OpenCV library to capture video from the webcam, track hand movements, and enable drawing functionalities based on recognized gestures.
- Python 3.x
- OpenCV (
cv2
) library - MediaPipe (
mediapipe
) library
- Install the required dependencies using
pip install opencv-python mediapipe
. - Run the
VirtualPainter.py
script to start the application.
- Launch the application by running
main.py
. - Place your hand in front of the webcam to start detecting hand gestures.
- Use specific hand gestures to switch between drawing modes and colors.
- For Drawing, stretch your palm with index finger open and all others closed, for switching between colors, open index and middle finger
- Draw on the screen by moving your hand while in drawing mode.
- Press 'q' to exit the application.
This project was created using the OpenCV
and MediaPipe
libraries.