Img = detector.findHands(img, draw=False) StackedImg = cvzone.stackImages(imgList, 3, 0.4)įrom cvzone.HandTrackingModule import HandDetector ImgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) LmList, bboxInfo = detector.findPosition(img, bboxWithHands=False)įrom cvzone.FaceMeshModule import FaceMeshDetector # length, info = detector.findDistance(lmList1, lmList2) # with drawįrom cvzone.PoseModule import PoseDetector Length, info, img = detector.findDistance(lmList1, lmList2, img) # with draw HandType2 = hand2 # Hand Type "Left" or "Right" LmList2 = hand2 # List of 21 Landmark pointsībox2 = hand2 # Bounding box info x,y,w,hĬenterPoint2 = hand2 # center of the hand cx,cy Your preferences are configured to warn you when images may be sensitive. HandType1 = hand1 # Handtype Left or Right LmList1 = hand1 # List of 21 Landmark pointsībox1 = hand1 # Bounding box info x,y,w,hĬenterPoint1 = hand1 # center of the hand cx,cy # hands = detector.findHands(img, draw=False) # without draw
Hands, img = detector.findHands(img) # with draw # bboxInfo - "id","bbox","score","center"Ĭv2.circle(img, center, 5, (255, 0, 255), cv2.FILLED)īasic Code Example from cvzone.HandTrackingModule import HandDetectorĭetector = HandDetector(detectionCon=0.8, maxHands=2)
You can simply use pip to install the latest version of cvzone.įrom cvzone.FaceDetectionModule import FaceDetector This is a Computer vision package that makes its easy to run Image processing and AI functions.