GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - problemsolvewithridoy/Game-controller-using-python: This project is a simple implementation of a game controller using Python and OpenCV. With this controller, you can control games using hand gestures captured by a webcam. This project is a great way to learn about computer vision, gesture recognition, and game development.

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
main.py
main.py
 
 

Repository files navigation

Game Controller using python and openCV

This project is a simple implementation of a game controller using Python and OpenCV. With this controller, you can control games using hand gestures captured by a webcam. This project is a great way to learn about computer vision, gesture recognition, and game development. let's start...............

To make this project you need to follow this step:-

Installation

Install package with pip

pip install cvzone==1.4.1
pip install mediapipe==0.8.3.1

Deployment

To deploy this project run

# Please Subscribe my youtube channel "Problem Solve with Ridoy"
import cv2
from cvzone.HandTrackingModule import HandDetector
from pynput.keyboard import Key, Controller

cap = cv2.VideoCapture(0)
cap.set(3, 320)
cap.set(4, 210)

detector = HandDetector(detectionCon= 0.7, maxHands= 1)
keyboard = Controller()

while True:
    _, img = cap.read()
    hands, img = detector.findHands(img)

    if hands:
        finger = detector.fingersUp(hands[0])
        if finger == [0,0,0,0,0]:
            keyboard.press(Key.left)
            keyboard.release(Key.right)

        elif finger == [1,1,1,1,1]:
            keyboard.press(Key.right)
            keyboard.release(Key.left)
         
    else:
        keyboard.release(Key.left)
        keyboard.release(Key.right)
        

    cv2.imshow("Problem Solve with Ridoy", img)
    if cv2.waitKey(1) == ord ("q"):
        break

Output

Now play

You can follow me

Facebook:- https://www.facebook.com/problemsolvewithridoy/

Linkedin:- https://www.linkedin.com/in/ridoyhossain/

YouTube:- https://www.youtube.com/@problemsolvewithridoy

Gmail:- [email protected]

If you have any confusion, please feel free to contact me. Thank you

License

This script is released under the MIT License. Feel free to use, modify, and distribute it as you wish. If you find any bugs or have any suggestions for improvement, please submit an issue or a pull request on this repository.

About

This project is a simple implementation of a game controller using Python and OpenCV. With this controller, you can control games using hand gestures captured by a webcam. This project is a great way to learn about computer vision, gesture recognition, and game development.

Topics

game-automationgame-automation-using-pythongame-controllergame-controller-using-python-and-opencvgame-developmentgame-with-pythongesture-control-gamegesture-recognitionopencvpython

Resources

Readme
MIT license
Activity

Stars

23 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.