This is python based game controller, which can play mouse and click using color objects.
- Idea is to find colour for two objects, one for moving mouse another for clicking it.
- Calculate external countours of both colored objects and use them to trigger mouse activity.
simple enough!!
File | Info |
---|---|
main.py |
To choose color |
game.py |
Game python file |
- So
main.py
is the file where you can place object in front of you and choose color parameters according to you! - After calculating color values of both colored objects, use the value in
game.py
.
- In
game.py
, you will get
lower_pink = np.array([139, 65, 121])
upper_pink = np.array([164, 88, 176])
lower_yellow = np.array([16, 101, 146])
upper_yellow = np.array([179, 255, 255])
- Change these values with your color values.
- So important thing is i have used
yellow
color to control the mouse andpink
to fire clicks. - Change your
yellow and pink
accordingly.