Skip to content

pandutripraptomo/Finger-Icon-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Finger Icon Detection 🀟

Finger Icon Detection is an innovative project that uses Python, OpenCV, and MediaPipe to track hand gestures and overlay custom icons above raised fingers in real-time. Whether you're looking to experiment with hand tracking or create interactive visual effects, this project offers a creative platform for gesture recognition and icon placement.

This project is ideal for those interested in computer vision, gesture recognition, and building interactive user experiences with simple setups like a webcam.

Finger Icon


🎨 Key Features

  • Real-time hand gesture tracking using MediaPipe, a framework developed by Google for efficient and accurate hand tracking.
  • Display custom icons above raised fingers (thumb, index, pinky).
  • Interactive feedback that visualizes hand movements and icon placement.
  • Leverages OpenCV for video feed processing and seamless icon rendering.
  • Fully customizable β€” you can replace icons or add new gestures to fit your needs!

πŸ’‘ How It Works

The project uses two core technologies for hand tracking and icon overlay:

1. MediaPipe Hand Tracking

  • MediaPipe provides high-quality, real-time hand tracking with 21 hand landmarks. These landmarks are mapped to a 2D plane to track the positions of individual finger tips and joints.
  • By analyzing the movement of these landmarks, we can determine if a finger is raised and show the corresponding icon above it.
  • Hand gestures are detected based on the relative position of these landmarks, such as thumb, index, and pinky tips.

2. OpenCV

  • OpenCV (Open Source Computer Vision Library) is used to capture video input from the webcam and process each frame.
  • The icons are overlaid onto the video feed using OpenCV’s image processing functions, with transparent backgrounds to blend them seamlessly.

πŸ› οΈ System Requirements

  • Python 3.x (Make sure you have Python installed).
  • Webcam: A working webcam is required for gesture detection.
  • Dependencies:
    • OpenCV: For capturing and processing video.
    • MediaPipe: For hand gesture detection and tracking.
    • NumPy: For efficient array handling in image processing.

Install the dependencies:

Run the following command to install the required libraries: pip install opencv-python mediapipe numpy


βš™οΈ Installation and Setup

Step 1: Install Dependencies

Run the following command to install the necessary libraries: pip install opencv-python mediapipe numpy

Step 2: Prepare Icons for Display

  • You’ll need three custom icons for each raised finger (thumb, index, pinky).
  • Download or create custom icons (e.g., j1.png, j2.png, j3.png).
  • Place these icons in the icons/ folder, located in the same directory as the script.

Step 3: Run the Script

Once your dependencies are installed and icons are ready, run the script with: python main.py

Step 4: Interact with the Program

  • Ensure your webcam is active and pointed at your hand.
  • Raise your thumb, index, or pinky to see the corresponding icon appear above the raised finger.
  • Press ESC to exit the program.

πŸ“‚ Folder Structure

The directory structure should look like this:

finger-icon-detection/ β”‚-- main.py
β”‚-- icons/
β”‚ β”‚-- j1.png
β”‚ β”‚-- j2.png
β”‚ β”‚-- j3.png
β”‚-- README.md


🎯 How to Extend the Project

1. Add More Icons or Gestures

You can modify the program to detect more hand gestures by analyzing additional landmarks (e.g., peace sign, thumbs up, open hand, etc.).

  • Add corresponding icons and create a dynamic way to switch between gestures based on detected hand poses.

2. Hand Pose Estimation

  • MediaPipe can provide detailed hand pose estimations, which allow for a more precise understanding of hand orientations.
  • This feature can help distinguish between similar gestures or enable new, more complex hand movements.

3. Gesture Recognition

  • Add machine learning models to recognize predefined gestures like sign language alphabets or specific commands.
  • Trigger specific actions based on recognized gestures, making the project more interactive.

4. Add Sound Feedback or Actions

  • To enhance user interaction, you could integrate sound effects when certain gestures are detected.
  • Additionally, you can trigger specific actions like opening websites, changing backgrounds, or controlling other applications.

βš™οΈ Troubleshooting

Here are some common issues you may encounter and how to resolve them:

  • Icons not displaying: Ensure the icons (j1.png, j2.png, j3.png) are placed correctly in the icons/ folder. The images should be in .png format with transparent backgrounds.
  • Webcam not working: If your webcam is not detected, check that no other applications (e.g., Zoom, Skype) are using it. Ensure your webcam drivers are up to date.
  • Hand not detected: Ensure there is sufficient lighting, and that your hand is clearly visible within the camera frame. MediaPipe works best when the hand is in high contrast with the background.

🀝 Contributing

Contributions are always welcome! If you have an idea for improving the project or want to add a new feature, please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-name.
  3. Commit your changes: git commit -m 'Added feature XYZ'.
  4. Push to your branch: git push origin feature-name.
  5. Create a Pull Request.

πŸ“œ License

This project is licensed under the MIT License.


🌟 Have fun experimenting with hand gestures, icons, and creative possibilities! πŸš€
Feel free to make this project your own and add more cool features!

About

πŸ€– Finger Icon Detection 🀟 A Python project using OpenCV and MediaPipe to track hand gestures in real-time and overlay custom icons above raised fingers (thumb, index, pinky). Perfect for experimenting with hand tracking and gesture recognition.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages