All projects

Repository

Eye-movement-mouse-control

Control your computer screen's scroll using your **eye blinks** via your webcam!

View source Jupyter Notebook0 stars ยท 0 forks

# ๐Ÿ‘๏ธ Eye Blink Scroll Controller

Control your computer screen's scroll using your **eye blinks** via your webcam!

- **Left eye blink** โ†’ Scroll **down**  
- **Right eye blink** โ†’ Scroll **up**  

This project uses **OpenCV** for real-time face and eye detection and **PyAutoGUI** to simulate scrolling.

---

## ๐Ÿ“ธ Demo

https://user-images.githubusercontent.com/your-demo.gif

---

## ๐Ÿง  How It Works

- Uses Haar Cascade classifiers to detect face and eyes.
- Analyzes eye region brightness:
  - A **closed eye** appears darker than an open one.
- Scrolls up/down based on which eye is closed while the other is open.
- Has a cooldown to prevent excessive triggering.

---

## ๐Ÿ”ง Features

โœ… Real-time eye tracking  
โœ… Blink-based scrolling logic  
โœ… No special hardware needed (just a webcam)  
โœ… Adjustable sensitivity  
โœ… Visual feedback (bounding boxes on eyes)

---

## ๐Ÿš€ Getting Started

### ๐Ÿ”ฉ Dependencies

Install the required packages:

```bash
pip install opencv-python pyautogui numpy

โ–ถ๏ธ Run the App

python eye_scroll.py

Press q to quit the window.


โš™๏ธ Configuration

You can fine-tune the sensitivity by adjusting this parameter in the code:

INTENSITY_THRESHOLD = 60  # Lower = more sensitive to blinking

Adjust scroll_cooldown (in seconds) to control how often scroll is triggered:

scroll_cooldown = 1.0  # seconds between scrolls

๐Ÿ› ๏ธ Future Improvements

  • Add calibration step for more accuracy
  • Use Dlib or Mediapipe for better landmark detection
  • Support for left/right scrolling
  • Add GUI toggle or hotkeys

๐Ÿง‘โ€๐Ÿ’ป Author

Nabeel Ali Khan ๐Ÿ”— GitHub ๐Ÿ’ผ AI & ML Enthusiast | Ethical Hacker | Backend Developer


๐Ÿ“œ License

This project is licensed under the MIT License.


```