cv2: [WARN: 0] global C: .. \ .. \ cap_msmf. cpp (674) SourceReaderCB :: ~ SourceReaderCB, завершающий асинхронный c обратный вызов - PullRequest
0 голосов
/ 19 марта 2020

Почему у меня возникла эта ошибка [WARN: 0] global C: .... \ cap_msmf. cpp (674) SourceReaderCB :: ~ SourceReaderCB прекращает асинхронный вызов c. Пожалуйста, помогите мне, я использую python 3.6.5 и Opencv 4.2.0

cap = cv2.VideoCapture(0)
    id = input("Please Input Your id: ")
    name = input("Please Input Your name: ")
    nums = 0
    while True:
        ret, img = cap.read()
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        faces = face_cascade.detectMultiScale(gray, 1.3, 5)
        for (x, y, w, h) in faces:
            nums = nums+1
            cv2.imwrite("C:\\Users\Marvin\Desktop\Opencv-face-detection-python-master\dataSet\."+str(id)+"."+str(nums)+".jpg", gray[y:y+h,x:x+w])
            cv2.rectangle(img, (x, y), (x + w, y + h), (255, 0, 0), 2)
            cv2.waitKey(100)

        connect.execute("INSERT INTO user(id,name) Values("+str(id)+",' "+str(name)+" ' )")
        connect.commit()
        cur.close()


        cv2.imshow('img', img)
        k = cv2.waitKey(1)
        if nums>20:
            break

    cap.release()
    cv2.destroyAllWindows()
...