A Python script that transforms facial movements into game controls using OpenCV and PyAutoGUI, creating a hands-free gaming experience.
Welcome to the OpenCV Face Game Controller repository! This project demonstrates an innovative application of computer vision technology by integrating OpenCV's dynamic face detection capabilities with PyAutoGUI to control video games using facial movements. By simply tilting your head, you can send commands to your favorite games, offering a novel, hands-free gaming experience.
Watch full video on vimeo
In an era where accessibility in technology is more crucial than ever, the ability to control games without physical controllers opens doors for users with mobility restrictions and offers a fun, unique way to interact with technology for everyone. This project not only highlights the flexibility of AI and computer vision technologies but also pushes the boundaries of traditional gaming interfaces.
- Face Detection: The application uses OpenCV to detect the user's face in real-time through a webcam feed.
- Motion Interpretation: Specific movements of the face (like turning or tilting) are captured and interpreted as game controls.
- Game Interaction: These movements are then translated into keyboard inputs via PyAutoGUI, allowing the user to control game actions directly through facial gestures.
Ensure you have the following installed:
- Python 3.6+
- OpenCV (opencv-python)
- PyAutoGUI
- Numpy
To get this project up and running on your local machine:
- Clone the Repository:
git clone https://github.com/<Brandi-Kinard>/opencv-face-game-control.git
- Install Requirements:
pip install opencv-python pyautogui numpy
- Run the Notebook: Navigate to the cloned directory and launch a code editor (e.g. PyCharm CE) to see the project in action.
If you want to add more, Please don't hesitate to open a pull request.