Skip to content

Commit 33a9045

Browse files
committed
Solved Merge Conflicts
2 parents adb6310 + 73c4221 commit 33a9045

4 files changed

Lines changed: 55 additions & 23 deletions

File tree

LICENSE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Creative Commons Attribution-NonCommercial 4.0 International
2+
3+
Copyright (c) 2025 Samyak Jain
4+
5+
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License.
6+
To view a copy of this license, visit: http://creativecommons.org/licenses/by-nc/4.0/
7+
8+
You are free to:
9+
- Share — copy and redistribute the material in any medium or format
10+
- Adapt — remix, transform, and build upon the material
11+
12+
Under the following terms:
13+
- Attribution — You must give appropriate credit and indicate if changes were made.
14+
- NonCommercial — You may not use the material for commercial purposes.

README.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
## Gesture-Based Math Solver (OpenCV + MediaPipe)
1+
# Gesture-Based Math Solver (OpenCV + MediaPipe)
22

33
This project is a **real-time hand gesture-based calculator** that lets you build and evaluate basic math expressions using only hand gestures in front of a webcam.
44

55
---
66

77
## Features
88

9-
- Real-time gesture detection using webcam
10-
- Supports multi-digit input (e.g., showing 2 → 4 → 7 becomes "247")
9+
- Real-time gesture detection using a webcam
10+
- Supports multi-digit input (e.g., 2 → 4 → 7 becomes `247`)
1111
- Gesture-controlled arithmetic operations (`+`, `-`, `*`, `/`)
1212
- Built-in evaluation and result display
13-
- Hands-free **Clear**, **DELETE** and **Exit** commands
14-
- Works using a standard webcam (no special hardware needed)
13+
- Hands-free **Clear**, **Delete**, and **Exit** gestures
1514

1615
---
1716

@@ -22,10 +21,20 @@ This project is a **real-time hand gesture-based calculator** that lets you buil
2221

2322
---
2423

25-
## Install
24+
## Installation
25+
26+
If you cloned this repo:
27+
28+
```bash
29+
git clone https://github.com/sam-1409/mathSolver.git
30+
cd mathSolver
31+
pip install -r requirements.txt
32+
```
33+
34+
If you already have the files locally, run:
2635

2736
```bash
28-
pip install opencv-python mediapipe numpy
37+
pip install -r requirements.txt
2938
```
3039

3140
---
@@ -36,23 +45,21 @@ pip install opencv-python mediapipe numpy
3645
python mathSolver.py
3746
```
3847

39-
Keyboard shortcuts while running:
48+
Keyboard shortcuts:
4049

41-
- `q` or `Esc`: quit
50+
- `q` / `Esc`: quit
4251
- `c`: clear
4352

4453
---
4554

46-
---
47-
4855
## Tech Stack
4956

50-
| Tool | Purpose |
51-
|-------------|-------------------------------------|
52-
| Python | Core programming language |
53-
| OpenCV | Video capture, frame rendering |
54-
| MediaPipe | Hand landmark detection (21 points) |
55-
| NumPy | Distance computation, math logic |
57+
| Tool | Purpose |
58+
|---|---|
59+
| Python | Core language |
60+
| OpenCV | Video capture + rendering |
61+
| MediaPipe | Hand landmark detection (21 points) |
62+
| NumPy | Distance computation + math helpers |
5663

5764
---
5865

@@ -68,12 +75,12 @@ Keyboard shortcuts while running:
6875
| Two hands: `1` + `4` (either order) | Append `/` |
6976
| Two hands: `0` + `0` | Evaluate (`=`) |
7077
| Two hands: `5` + `5` | Clear |
71-
| Two hands: `2` + `2` | Delete last char |
78+
| Two hands: `2` + `2` | Delete last character |
7279
| Two hands: `1` + `1` with index fingertips very close | Exit |
7380

7481
Notes:
7582

76-
- Gestures are based on MediaPipe hand landmarks and finger state detection.
83+
- Gestures are based on MediaPipe landmarks and simple finger-state rules.
7784
- The app uses a debounce delay (currently ~1.25s) to avoid repeated inputs; adjust `delay` in `mathSolver.py` if needed.
7885

7986
---
@@ -91,6 +98,13 @@ See `CONTRIBUTING.md` for setup and guidelines.
9198

9299
---
93100

101+
## License
102+
103+
This project is licensed under the **Creative Commons Attribution–NonCommercial 4.0 International License**.
104+
To learn more, see https://creativecommons.org/licenses/by-nc/4.0/.
105+
106+
---
107+
94108
## Credits
95109

96110
- Original author: @youngcoder45

mathSolver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ def detectGesture(hand1_data, hand2_data):
3232
return "/"
3333
elif (f1==2 and f2==2):
3434
return "del"
35-
elif (f1==1 and f2==5) or (f1==5 and f2==1):
35+
elif (f1+f2==6):
3636
return "6"
37-
elif (f1==2 and f2==5) or (f1==5 and f2==2):
37+
elif (f1+f2==7):
3838
return "7"
39-
elif (f1==3 and f2==5) or (f1==5 and f2==3):
39+
elif (f1+f2==8):
4040
return "8"
41-
elif (f1==4 and f2==5) or (f1==5 and f2==4):
41+
elif (f1+f2==9):
4242
return "9"
4343
elif f1==0 and f2==0:
4444
return "="

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
mediapipe==0.10.21
2+
numpy==2.3.1
3+
opencv_contrib_python==4.11.0.86
4+
opencv_python==4.11.0.86

0 commit comments

Comments
 (0)