https://github.com/aakashjhawar/hand-gesture-recognition
Detect number of fingers from image or video using OpenCV
https://github.com/aakashjhawar/hand-gesture-recognition
computer-vision convex-hull cv2 deep-learning finger-count-recognition finger-detection hand-detection hand-gesture hand-gesture-recognition hand-gestures hand-recognition hand-segment image-processing image-segmentation machine-learning opencv python
Last synced: about 2 months ago
JSON representation
Detect number of fingers from image or video using OpenCV
- Host: GitHub
- URL: https://github.com/aakashjhawar/hand-gesture-recognition
- Owner: aakashjhawar
- License: mit
- Created: 2019-03-13T12:27:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-22T18:30:41.000Z (over 5 years ago)
- Last Synced: 2025-04-19T07:10:48.618Z (6 months ago)
- Topics: computer-vision, convex-hull, cv2, deep-learning, finger-count-recognition, finger-detection, hand-detection, hand-gesture, hand-gesture-recognition, hand-gestures, hand-recognition, hand-segment, image-processing, image-segmentation, machine-learning, opencv, python
- Language: Jupyter Notebook
- Homepage:
- Size: 1.61 MB
- Stars: 18
- Watchers: 0
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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-
## Result
#### One
#### Two
#### Three
#### Four
#### Five
###### *Segmentation of some image are improper as the lighting in the room was uneven.*