- Gesture Recognition 🤖: Through the camera, the system identifies hand gestures representing the letters A to E.
- Drawing Landmarks ✍️: MediaPipe draws the hand landmarks, allowing for a clear visualization of what is being processed.
- Letter Display 🔠: When a gesture is recognized, the corresponding letter is displayed on the screen.
- Real-time Video Feed 📹: The video feed is processed in real-time, and the letters are updated as the gestures are detected.
- Python 3.x 🐍
- OpenCV 📸: For video capture and image processing.
- MediaPipe ✋: For detecting and analyzing hand landmarks.
- Matplotlib 📊 (if needed for graph display, though not used in this specific code).
Make sure you have the following Python packages installed:
opencv-pythonmediapipemath(integrated in Python)
You can install the dependencies with the following command:
pip install opencv-python mediapipe-
Connect Your Camera 📷: Ensure your camera is connected to your device. The code uses the camera located at
/dev/video1. If necessary, adjust to the correct device. -
Run the Script
▶️ : Simply run the Python file. The script will open a window showing the video feed from your camera with the hand gestures being processed in real-time.python hand_gesture_recognition.py
-
Recognized Gestures 🤲:
- A: Thumb up and index finger bent.
- B: All fingers extended and together.
- C: A "C" shape with the hand.
- D: Thumb bent and the other fingers extended.
- E: All fingers curled over the palm.
-
Close the Application ❌: To close the application, simply press the
qkey while the window is open.
distance(a, b): Function to calculate the Euclidean distance between two points.- Letter Identification Functions 🔠: The functions
is_letter_a(),is_letter_b(),is_letter_c(),is_letter_d(), andis_letter_e()are responsible for checking if the hand gestures correspond to one of the letters A to E. - Video Capture and Image Processing 📸: The code captures images from the camera, converts them to RGB, and processes them using MediaPipe to detect hand landmarks.
- Letter Display 🔠: If a corresponding gesture is identified, the name of the letter is displayed on the screen.
