Coder Social home page Coder Social logo

lazy-reader's Introduction

Hand Gesture Controlled Scrolling

This project allows you to scroll a webpage up and down by detecting the vertical movement of your index finger using your webcam. It utilizes MediaPipe for hand tracking and pyautogui for simulating scroll events.

#Picture { height =200px width=250px}

Requirements

  • Python 3.x
  • OpenCV
  • MediaPipe
  • PyAutoGUI
  • NumPy

Installation

  1. Clone the repository:

    git clone <repository_url>
    cd <repository_directory>
  2. Create and activate a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate   # On Windows, use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt

Usage

  1. Run the script:

    python hand_gesture_scroll.py
  2. The script will open a window displaying the video feed from your webcam. Move your index finger up or down in front of the camera to scroll the page.

  3. Press the 'q' key to quit the application.

How It Works

  • The script captures video frames from your webcam and processes them using MediaPipe's hand tracking solution.
  • It detects the position of the index finger and calculates the vertical movement.
  • If the movement exceeds a threshold and the cooldown period has passed, it simulates a scroll event using pyautogui.
  • A 3-second cooldown period is implemented to allow the finger to return to a neutral position after scrolling.

Troubleshooting

  • Ensure that your webcam is properly connected and working.
  • Make sure you have installed all the required packages.
  • Adjust the sensitivity and thresholds if the scrolling is too sensitive or not responsive enough.

Contributing

If you have any suggestions or improvements, feel free to create a pull request or open an issue.

License

This project is licensed under the MIT License.

lazy-reader's People

Contributors

bhishekarora avatar

Watchers

 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.