This Python program uses your webcam along with MediaPipe to detect hand gestures and control the cursor and scroll on your screen.
I often find myself sitting for long periods unnecessarily, such as when reading documentation or watching tutorials and online courses. This small program helps reduce unnecessary sitting by allowing you to control your computer remotely with hand gestures.
- Python 3.x (Download Python)
- OpenCV
pip install opencv-python
- MediaPipe
pip install mediapipe
- NumPy
pip install numpy
- Clone this repository or download the
scroll_camera.pyfile. - Run the script:
python scroll_camera.py
- Follow the on-screen instructions to allow camera access.
- Use the specified hand gestures to control the cursor and scrolling.
if you clone all the repo you need to run the script with
python gesture-scroll/scroll_camera.pyOnly one hand at a time ✋
Move the pointer: Make a fist. The pointer will follow your wrist (landmark 0).
Scroll: Once you're in the right place, just open your hand.
Scroll up: While showing your open palm ✋, rotate your hand to the right to scroll up.
Scroll down: While showing your open palm ✋, rotate your hand to the left to scroll down.
- If the camera feed doesn't appear, ensure no other application is using the camera.
- For gesture recognition issues, ensure your hand is visible and well-lit.
- Adjust the camera resolution in the script for better performance on low-spec machines.
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License - see the LICENSE file for details.