FaceToJoystick is a tool allowing you to use your head as a joystick, similiar to opentrack but more compatable with linux.
- Python 3.x
- OpenCV (
opencv-pythonpackage) - Numpy
- vgamepad library (for virtual joystick control)
- Webcam (built-in or external) for capturing facial movements
- Clone the repository to your local machine:
git clone https://github.com/PeaceNira/FaceToJoystick.git
- Install the required Python packages:
pip install opencv-python vgamepad numpy
- Connect your webcam to your computer.
- Run the
main.pyscript:
python main.py
-
Position your face in front of the webcam.
-
Look left, right, up, or down to control the virtual joystick.
-
Press the 'r' key to reset the initial face position if needed.
-
Press the 'q' key to exit the program.
-
The X output is Controller axis 4, and the Y output is axis 5.
-
Constants contain options you can edit to your desire, or when the application is launched via the GUI.
Contributions are welcome and am hoping to build this project into a good linux alternative to opentrack.
This project is licensed under the MIT license. See the LICENSE file for details.
Drastic changes in light will cause the face to bounce around, so will extremely dark/light settings.