Есть ли конфликт между Python gattlib и OpenCV? - PullRequest
1 голос
/ 09 мая 2019

Я хочу создать программу на Python, открывающую веб-камеру с OpenCV и управляющую устройством Bluetooth с помощью gattlib на Raspberry Pi. Вот код:

import cv2
import threading
from gattlib import GATTRequester
from time import sleep

cap = cv2.VideoCapture(0)
cap.set(3, 320)
cap.set(4, 240)

while(True):
    print(1)
    ret, frame = cap.read()
    print(2)
    cv2.imshow('frame', frame)
    print(3)
    key = cv2.waitKey(1) & 0xFF
    print(4)
    if key == ord('q'):
        break

# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()

Странно то, что он заблокирует поток на key = cv2.waitKey(1) & 0xFF.

enter image description here

Если я удалю from gattlib import GATTRequester, код может хорошо работать.

Кто-нибудь знает, что здесь происходит?

Спасибо!

...