Skip to content

Commit 6f6e5e0

Browse files
readme.md file added
1 parent b0e8b9d commit 6f6e5e0

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed

README.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,125 @@
1+
12
# Robotics Hand Simulator using Python and openCV
3+
4+
This project is a hand simulator for robotics applications, built with Python and a number of computer vision libraries. Using the CVZone and Mediapipe modules, the simulator tracks the movement of the user's hand and fingers in real-time, then maps these movements onto a 3D hand model. The OpenCV library is used for image processing and computer vision tasks.
5+
6+
The simulator is designed to be easy to use and customizable. It includes a number of built-in hand poses and gestures, such as a closed fist, open palm, and pointing finger, which can be modified or expanded as needed. The simulator also allows the user to adjust the lighting and color of the 3D model, as well as the camera angle and perspective.
7+
8+
This project is ideal for robotics students, researchers, or enthusiasts who want to experiment with hand tracking and motion control in a virtual environment. With its intuitive interface and powerful tracking capabilities, the simulator is a valuable tool for exploring the possibilities of robotics and human-machine interaction.
9+
10+
let's start...............
11+
12+
To make this project you need to follow this step:-
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
## Installation
24+
25+
Install package with pip
26+
27+
```bash
28+
pip install cvzone==1.4.1
29+
pip install mediapipe==0.8.3.1
30+
```
31+
32+
## Deployment
33+
34+
To deploy this project run
35+
36+
```bash
37+
# Please Subscribe my youtube channel "@problemsolvewithridoy"
38+
import cv2
39+
from cvzone.HandTrackingModule import HandDetector
40+
import os
41+
import time
42+
43+
# select camera and make a fream
44+
cap = cv2.VideoCapture(0)
45+
cap.set(3, 1280)
46+
cap.set(4, 720)
47+
48+
# make a detector for hand
49+
detector = HandDetector(detectionCon=0.7, maxHands= 2)
50+
51+
pTime = 0
52+
53+
# for select finger image path
54+
img_path = "NewFingerPic"
55+
img_list = os.listdir(img_path)
56+
57+
# for make a finger image list
58+
hand_img = []
59+
for i in img_list:
60+
image = cv2.imread(f"{img_path}/{i}")
61+
hand_img.append(image)
62+
63+
while True:
64+
success, img = cap.read()
65+
66+
# for flip video capture
67+
img = cv2.flip(img, 1)
68+
69+
# detect hand
70+
hands, img = detector.findHands(img)
71+
72+
# for make FPS
73+
cTime = time.time()
74+
fps = 1/(cTime - pTime)
75+
pTime = cTime
76+
77+
# for print FPS in video fream
78+
cv2.putText(img, f"FPS:{int(fps)}", (1100, 50), cv2.FONT_HERSHEY_PLAIN, 3, (255,0,0),3)
79+
80+
if len(hands) == 1:
81+
# detect fingers
82+
hand_fingers = detector.fingersUp(hands[0])
83+
if hand_fingers == [0,0,0,0,0] :
84+
img[0:400, 0:400] = hand_img[0]
85+
elif hand_fingers == [0,1,0,0,0]:
86+
img[0:400, 0:400] = hand_img[1]
87+
elif hand_fingers == [0,1,1,0,0]:
88+
img[0:400, 0:400] = hand_img[2]
89+
elif hand_fingers == [0,1,1,1,0]:
90+
img[0:400, 0:400] = hand_img[3]
91+
elif hand_fingers == [0,1,1,1,1]:
92+
img[0:400, 0:400] = hand_img[4]
93+
elif hand_fingers == [1,1,1,1,1]:
94+
img[0:400, 0:400] = hand_img[5]
95+
else:
96+
img[0:400, 0:400] = hand_img[8]
97+
98+
elif len(hands) == 2:
99+
img[0:400, 0:400] = hand_img[7]
100+
else:
101+
img[0:400, 0:400] = hand_img[6]
102+
103+
cv2.imshow("Problem Solve With Ridoy", img)
104+
if cv2.waitKey(1) & 0xFF == ord("q"):
105+
break
106+
```
107+
## Note:You need to store these images in your project folder
108+
109+
![sfs](https://user-images.githubusercontent.com/123636419/232227755-5b919f9b-f34b-414b-8b9b-e086ac0f83a8.PNG)
110+
## You can follow me
111+
112+
Facebook:- https://www.facebook.com/problemsolvewithridoy/
113+
114+
Linkedin:- https://www.linkedin.com/in/ridoyhossain/
115+
116+
YouTube:- https://www.youtube.com/@problemsolvewithridoy
117+
118+
119+
120+
If you have any confusion, please feel free to contact me. Thank you
121+
122+
123+
## License
124+
This script is released under the MIT License. Feel free to use, modify, and distribute it as you wish. If you find any bugs or have any suggestions for improvement, please submit an issue or a pull request on this repository.
125+

0 commit comments

Comments
 (0)