Coder Social home page Coder Social logo

handybird's Introduction

HandyBird

HandyBird is the classic game Flappy Bird written in C++ using OpenCV4 and SFML libraries with real-time hand gesture detection to fly the bird instead of using keyboards.

Prerequisites

  • C++ compiler (gcc, g++, ...)
  • OpenCV
  • Cmake
  • SFML

For C++ compiler, Cmake, SFML and their dependencies, use following command:

sudo apt-get install cmake g++ libsfml-dev

Installation

mkdir build && cd build && cmake .. && cd ..
cmake -S . -B build
cmake --build build

Then you can run the program:

build/HandyBird

Principles

Hand Detection

  • Initialy, we need to remove background behind the user so that the program can find it easier to detect user's hand. After running the program, 2 windows camera and foreground show up. The camera is the main window for you to track yourself while playing. The foreground window is used to guarantee the background is removed properly. To start removing the background, without showing hand on the camera, press b, the foreground window will show images of removal of the background and user's face. If it's not done properly, press b and repeat the step.

  • Then, we will find user's color skin. In order to do that, user need to place their hand in the sample area and press s key. The foreground window will disappear and the contour of user's hand will be shown on the camera window.

How to play

  • To start playing game, we move the cursor to the Handy Bird window and press space. To fly up the bird, open your hand widely which is equal to press space in Flappy Bird game. To stop flying, close your hand like a fist (equal to release space). When the game is over, press c to continue and repeat pressing space key and continuing to play.

handybird's People

Contributors

nhuhoang0701 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

aismann

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.