GithubHelp home page GithubHelp logo

aakashjhawar / hand-gesture-recognition Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 14.0 1.65 MB

Detect number of fingers from image or video using OpenCV

License: MIT License

Jupyter Notebook 89.04% Python 10.96%
python opencv convex-hull hand-segment hand-gesture-recognition image-processing machine-learning hand-gestures image-segmentation computer-vision

hand-gesture-recognition's Introduction

Hand Gesture Recognition

• Extract and segment hand region from the video sequence.

• Recognize the number of fingers from the segmented hand region by using Convex Hull.

Getting Started

How to use

git clone https://github.com/aakashjhawar/Hand-Gesture-Recognition.git
cd Hand-Gesture-Recognition

Run the Finger_count.ipynb Jupyter Notebook

Prerequisites

  • Python 3.5
  • OpenCV
sudo apt-get install python-opencv

Procedure

  • Strategy for counting fingers
    • Garb an ROI (Region of interest)
      • Calculate a running average background value for 60 frames of video
      • Once average value is found, then the hand can enter the ROI
  • Set a ROI and calculate the average running value for some amount of frames
  • Then once a hand enters, we can detect change and apply thresholding
  • Strategy for counting fingers * Once the hand enters the ROI, we will use a Convel Hull to draw a polygon around the hand * Using some maths, we'll calculate the center of the hand against the angle of outer points to infer finger count
  • The next step is to use thresholding to grab the hand segment from the ROI
  • Now that we have the hand segment, the next step is to actually count the fingers behind held up
  • We can do this by utilizing a Convex Hull
  • A convex hull draws a polygon by connecting points around the most external points in a frame
  • In our case, this set of points is actually just our threshold image of a hand.
  • We can expect a general shape of our polygon to be something like
  • Then using a ratio of that distance we create a circle
  • Any points outside of this circle far away enough from the bottom, should be extended fingers

Working

Image-

Image of segmented hand region

Result

One

One

Two

Two

Three

Three

Four

Four

Five

Five

Segmentation of some image are improper as the lighting in the room was uneven.

hand-gesture-recognition's People

Contributors

aakashjhawar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hand-gesture-recognition's Issues

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.