Comments (1)
from cvzone.HandTrackingModule import HandDetector
import cv2
cap = cv2.VideoCapture(0)
detector = HandDetector(detectionCon=0.8, maxHands=2)
while True:
success, img = cap.read()
hands, img = detector.findHands(img)
if hands:
for hand in hands:
lmList = hand["lmList"]
bbox = hand["bbox"]
centerPoint = hand['center']
handType = hand["type"]
fingers = detector.fingersUp(hand)
# Perform operations for each hand separately
# Additional operations for multiple hands (if needed)
cv2.imshow("Image", img)
if cv2.waitKey(1) == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Try the above code, make sure you use the latest version of cvzone.
In the code, I just introduced a for loop to iterate over the list of detected hands (hands). This allows the script to handle multiple hands individually.
Hope this helps!
from cvzone.
Related Issues (20)
- Detect key points for legs image HOT 1
- module 'HandTrackingModule' has no attribute 'handDetector' HOT 2
- Can't find documentation for cvzone HOT 1
- Reverse order of RGB code in cvzone.cornerRect HOT 2
- UnboundLocalError: local variable 'fingers' referenced before assignment HOT 2
- mediapipe not working HOT 3
- AttributeError: module 'cvzone' has no attribute 'FPS' HOT 2
- 'hand detector' object has no attribute 'hands, HOT 1
- Issue with mediapipe module not found HOT 1
- Lack of type annotation
- issue with calculate distance between fingers
- 'PoseDetector' object has no attribute 'results'
- Pupil coordinates in face mesh detection?
- can we use cvzone to detect hand and face in same time
- ValueError: too many values to unpack (expected 2) HOT 1
- 'HandDetector' object has no attribute 'findPosition'
- Classifier still uses "self.model = tensorflow.keras.models.load_model(self.model_path)", which causes "AttributeError: module 'tensorflow' has no attribute 'keras'" error HOT 1
- Face and finger detection issue HOT 2
- Cannot install cvzone HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cvzone.