Skip to content

A simple program in python to implement my hands-on learning of python packages like open-cv & mediapipe.

Notifications You must be signed in to change notification settings

SOHAM-DEV2/XEyeTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‘οΈ Eye Tracking Mouse Control(XEyeTracker)

Control your computer mouse and perform actions using just your eyes and head movements! This Python application uses your webcam to track eye movements for cursor control, detect blinks for clicking, and recognize head nods for scrolling.

✨ Features

  • πŸ‘€ Eye-Controlled Cursor: Move your mouse cursor by looking around the screen
  • πŸ˜‰ Blink to Click: Close your left eye to perform a mouse click
  • πŸ™‚ Head Nod Scrolling:
    • Nod down to scroll down
    • Nod up to scroll up
  • 🎯 Smooth Movement: Built-in cursor smoothing for precise control

πŸ“¦ Required Packages

Before running the application, install these dependencies:

pip install opencv-python mediapipe pyautogui

Or use the requirements file:

pip install -r requirements.txt

requirements.txt:

opencv-python
mediapipe
pyautogui

You can also use opencv-contrib-python instead of opencv-python.

πŸš€ How to Use

1. Fork & Clone the Repository

# Fork this repo on GitHub, then clone your fork
git clone https://github.com/YOUR-USERNAME/eye-tracking-control.git
cd eye-tracking-control

2. Install Dependencies

pip install -r requirements.txt

3. Run the Application

python eye_tracking_control.py

4. Controls

  • Move cursor: Look at different parts of your screen
  • Click: Blink your left eye
  • Scroll down: Nod your head down
  • Scroll up: Nod your head up
  • Exit: Press ESC key

βš™οΈ Customization

You can adjust these parameters in the code for better performance:

  • smooth_limit: Number of points averaged for smoother cursor movement (default: 5)
  • nod_threshold: Sensitivity of head nod detection (default: 0.015)
  • Blink threshold: Adjust the value 0.004 for click sensitivity

πŸ–₯️ System Requirements

  • Python: 3.7 or higher but lower than 3.12(as mediapipe got depreciated in 3.12 releases)
  • Webcam: Required for face tracking
  • OS: Windows, macOS, or Linux

⚠️ Important Notes

  • Ensure good lighting for accurate face tracking
  • Position yourself at a comfortable distance from the webcam
  • The application needs camera permissions to run
  • Cursor control may take a moment to calibrate to your movements

πŸ› οΈ Technologies Used

  • OpenCV: Video capture and image processing
  • MediaPipe: Face mesh detection and landmark tracking
  • PyAutoGUI: Mouse control automation

πŸ“ License

MIT License - Feel free to modify and distribute!

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.


About

A simple program in python to implement my hands-on learning of python packages like open-cv & mediapipe.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages