GithubHelp home page GithubHelp logo

muellllkreis / gesture_detection_unity Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 9.39 MB

An openCV based Unity game that is controlled via hand gesture detection from the player's live webcam feed. First implementation is an online rock paper scissors game.

C# 22.63% ShaderLab 67.84% HLSL 9.54%

gesture_detection_unity's Introduction

gesture_detection_unity

An openCV based Unity game that is controlled via hand gesture detection from the player's live webcam feed.

How to Play

To launch the game, you will need a machine running a Windows operating system and run the Gesture Detection.exe file. Under Single Player you can then choose the game that you want to play.

Calibrate Program

When a game is selected, the game screen and two camera feed windows will appear. To calibrate the program, make sure to be in an environment with a non-dynamic background and ideally static lighting. Hover your hand over the four green rectangles in the camera feed and make sure to cover them completely. Then, press SPACE to perform the skin extraction based on your hand. You can adjust the Binary Mask Threshold sliders in the game screen to change the sensitivity of the binary mask. If you are unhappy with the skin extraction, you can repeat the process multiple times. When the binary mask shows a clear white hand contour without a lot of noise, press RETURN to launch the hand detection. You will see the results of the detection in the feed, and the 3D hand model will follow your hand.

If you are in an environment with a noisy background, tick the background removal checkbox and try to adjust the sliders.

Rock Paper Scissors

When the play button is pressed, the game counts down from three. It will compare your pose after the countdown has finished with the random pose performed by the AI. Each round ends with either one of the players getting a point, or noone getting a point in case of a draw.

Drawing Game

Your furthest fingertip is used to paint on a canvas. Use your open hand (paper gesture) to change to a different random color and a closed hand (rock pose) to erase your drawings on the canvas.

!!Experimental!! Multiplayer

There is another build of the game which includes a multiplayer version of Rock-Paper-Scissors. To play, one player should open the game clicking on Multiplayer and then Start Host. Another player can then join by entering the correct IP address in the field below join session (port forwarding has to be enabled on the host) and join the game. The game works in the same way as described above.

gesture_detection_unity's People

Contributors

acrickx avatar muellllkreis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.