Game controller using webcam made with computer vision - Python and openCv
Video Testing avaiable on https://drive.google.com/file/d/1n6ne1MEXkC8eL9NN0Hjf7Kt4hUbVqlOZ/view?usp=sharing
Install requirements:
pip install -r requirements.txt
- Script file using webcam
gameController.py
python gameController.py
- Notebook explaing 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'),
}
A = ⬅
- Pressed when angle is positive
D = ➡
- Pressed when angle is negative
W = ⬆
- Pressed when mass is bigger than 5000
S = ⬇
- Pressed when mass is less than 3000
You have to use this image to control your car (or horse):
Image avaiable on ./images/steeringwheel.jpeg
Developed by Jean Jacques and Gabriel Petillo