def main():
    detector = htm.HandDetector()
    while True:
        (success, img) = cv2.imread('/home/laughinglouds/Pictures/Webcam/2021-04-13-133250.jpg')
        img = detector.findHands(img)
        lmlist = detector.findPosition(img, draw=True)
        hand_exists = len(lmlist)
        tipIDs = [4, 8, 12, 16, 20]
        dipIDs = [2, 7, 11, 15, 19]
        count = 0
        cc = 0
        if hand_exists:
            for i in range(0, 5):
                if (i == 0):
                    count += thumbIncrementCheck(lmlist)
                elif ((lmlist[tipIDs[i]][2] < lmlist[dipIDs[i]][2]) and (tipIDs[i] in (8, 12))):
                    count += 1
                    cc += 1
                elif (lmlist[tipIDs[i]][2] < lmlist[dipIDs[i]][2]):
                    count += 1
        else:
            count = (- 1)
        txt = textOutput(count, cc)
        cv2.putText(img, str(txt), (10, 140), cv2.FONT_HERSHEY_PLAIN, 3, (0, 0, 255), 3)
        cv2.imshow('Image', img)
        if ((cv2.waitKey(1) & 255) == ord('q')):
            break
def main():
    detector = htm.HandDetector()
    while True:
        (success, img) = cv2.imread('/home/laughinglouds/Pictures/Webcam/2021-04-13-133250.jpg')
        img = detector.findHands(img)
        lmlist = detector.findPosition(img, draw=True)
        hand_exists = len(lmlist)
        tipIDs = [4, 8, 12, 16, 20]
        dipIDs = [2, 7, 11, 15, 19]
        count = 0
        cc = 0
        if hand_exists:
            for i in range(0, 5):
                if (i == 0):
                    count += thumbIncrementCheck(lmlist)
                elif ((lmlist[tipIDs[i]][2] < lmlist[dipIDs[i]][2]) and (tipIDs[i] in (8, 12))):
                    count += 1
                    cc += 1
                elif (lmlist[tipIDs[i]][2] < lmlist[dipIDs[i]][2]):
                    count += 1
        else:
            count = (- 1)
        txt = textOutput(count, cc)
        cv2.putText(img, str(txt), (10, 140), cv2.FONT_HERSHEY_PLAIN, 3, (0, 0, 255), 3)
        cv2.imshow('Image', img)
        if ((cv2.waitKey(1) & 255) == ord('q')):
            break