Coder Social home page Coder Social logo

petrovevgeniy / handtrackingproject Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 492 KB

๐Ÿ‘ HandTrackingProject is a Python script for hand tracking using MediaPipe and OpenCV. It enables real-time hand detection and tracking in a webcam feed, providing visualizations of hand landmarks and connections.

License: MIT License

Python 100.00%
30fps hand-detection mediapipe opencv python3 real-time visualization

handtrackingproject's Introduction

๐Ÿ‘ HandTracking using MediaPipe and OpenCV

This repository contains a Python script for hand tracking using MediaPipe and OpenCV. It utilizes the MediaPipe library to detect and track hands in a live webcam feed, drawing landmarks and connections on the detected hands.

๐Ÿ› ๏ธ Requirements

  • Python 3.x ๐Ÿ
  • OpenCV (cv2) ๐Ÿ“ท
  • MediaPipe (mediapipe) ๐ŸŽฅ

โฌ‡๏ธ Installation

To install the required libraries, run the following command:

pip install opencv-python mediapipe

๐Ÿš€ Usage

  1. Clone this repository or download the HandTracking.py script.

  2. Run the script using the following command:

python HandTracking.py
  1. Once the script is running, it will open your webcam feed and start detecting and tracking your hands.

  2. You'll see landmarks and connections drawn on your hands in real-time.

  3. Press the 'Esc' key to exit the program.

โœจ Features

  • Detects and tracks multiple hands in a webcam feed.
  • Draws landmarks and connections on the detected hands for visualization.
  • Calculates and displays the frame rate (FPS) of the webcam feed.

๐Ÿค Examples

  • HandGestureImageHolder.py script showcases an example of how to display a custom image on the screen and it gives the illusion that you are holding an image with just your three fingers (thumb,index and middle). The picture will move along the screen as long as you are maintaining this specific (Italian) gesture

๐Ÿ”ง Customization

You can import the HandTrackingModule.py script and customize the behavior of the hand detector by modifying the parameters in the handDetector class constructor of the script. Here are some parameters you can adjust:

  • mode: Set to True if using static images (default is False for webcam feed).
  • maxHands: Maximum number of hands to detect (default is 2).
  • detectionCon: Minimum confidence threshold for hand detection (default is 0.5).
  • trackCon: Minimum confidence threshold for hand tracking (default is 0.5).

You can also modify the drawing specifications (e.g., colors, thickness) by editing the findHands() and findPosition() methods in the handDetector class.

๐Ÿ™ Credits

This script utilizes the following libraries:

  • OpenCV - Open Source Computer Vision Library
  • MediaPipe - A cross-platform framework for building multimodal applied ML pipelines

Special thanks to Murtaza's Workshop - Robotics and AI for their valuable tutorials and resources in the field of Robotics and AI.

License ๐Ÿ“

This project is licensed under the MIT License - see the LICENSE file for details.

handtrackingproject's People

Contributors

petrovevgeniy avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.