This is a game controller which i made in openCV and python.
This acts as a simulator for your games and lets you play your game with the help of a ball which is identified from the camera of your laptop. Once the ball is identified a circle will be drawn around the ball with a center of the ball in colour.
A box is also drawn in dark green colour, sides of which acts as the directions for our game. When you take the ball and pass it beyond the sides, it will trigger the particular keystore and the character, in my case car, will be turning in that particular direction.
You can play games like Subway surfer, temple run, any car game being controlled by A, W, S, D keys.
I have tested the contoller in online games and it game almost good results.
The inputs to the game are given with the help of a python library, pynput.
Things used in this project:-
- Python
- OpenCV
- Pynput
- imutils
Some snaps from the project
- Full video