This project uses OpenCV and MediaPipe to control the cursor with face movements and eye blinks. By leveraging MediaPipe's Face Mesh for precise facial landmark detection, this script maps specific face points to screen coordinates, allowing for intuitive cursor control and click actions.
- Face Tracking: Uses MediaPipe Face Mesh to track facial landmarks.
- Cursor Control: Moves the cursor based on facial landmark positions.
- Click Action: Simulates a mouse click when specific facial gestures are detected (e.g., eye blinks).
- Face Detection: The script captures video from the webcam and processes each frame to detect face landmarks.
- Landmark Mapping: It identifies key landmarks around the eyes and maps them to screen coordinates.
- Cursor Movement: The cursor is moved to the corresponding screen position of the landmarks.
- Click Detection: If the vertical distance between specific eye landmarks is small enough (indicating a blink), a mouse click is simulated.
- OpenCV
- MediaPipe
- PyAutoGUI
- Ensure you have a webcam connected to your system.
- Install the required libraries:
pip install opencv-python mediapipe pyautogui
- Run the script:
python main.py
##Acknowledgements I would like to mention that this project was inspired from the following youtube video. Great Work. Must Watch. https://www.youtube.com/watch?v=vJWzH_2F64g
This project is licensed under the MIT License.