Game controller using webcam made with computer vision - Python and openCv
Install requirements:
pip install -r requirements.txt
- Script file using webcam
gameController.py
python gameController.py
- Notebook explaining the functions
notebook/gameControllerNotebook.ipynb
keys = {
'A': pynput.keyboard.KeyCode.from_char('a'),
'D': pynput.keyboard.KeyCode.from_char('d'),
'W': pynput.keyboard.KeyCode.from_char('w'),
'S': pynput.keyboard.KeyCode.from_char('s'),
}
- Pressed when angle is positive
- Pressed when angle is negative
- Pressed when mass is bigger than 5000
- Pressed when mass is less than 3000
You can use this image to control your car (or horse):
Image avaiable on ./images/steeringwheel.jpeg
developed by Jean Jacques and Gabriel Petillo