Как вывести изображение из Tello ryze на Python
При запуске различных программ для вывода изображений с камеры квадрокоптера Tello выдает одинаковые непонятные ошибки. Я хочу получить видео, как с камеры ноутбука, через OpenCV. Я запускаю код через IDLE. Я пробовал разные программы с версиями Python 3.11 и 3.10. Пример кода:
from djitellopy import tello
import cv2
me = tello.Tello()
me.connect()
print(me.get_battery())
me.streamon()
while True:
img = me.get_frame_read().frame
img = cv2.resize(img, (360, 240))
cv2.imshow("results", img)
cv2.waitKey(1)
Вывод:
[INFO] tello.py - 129 - Tello instance was initialized. Host: '192.168.10.1'. Port: '8889'.
[INFO] tello.py - 438 - Send command: 'command'
[INFO] tello.py - 462 - Response command: 'ok'
[INFO] tello.py - 438 - Send command: 'streamon'
47
[INFO] tello.py - 462 - Response streamon: 'ok'
Traceback (most recent call last):
File "C:\Users\Roman\dronecur\dronecur\venv\lib\site-packages\djitellopy\tello.py", line 1049, in __init__
self.container = av.open(self.address, timeout=(Tello.FRAME_GRAB_TIMEOUT, None))
File "av\container\core.pyx", line 401, in av.container.core.open
File "av\container\core.pyx", line 272, in av.container.core.Container.__cinit__
File "av\container\core.pyx", line 292, in av.container.core.Container.err_check
File "av\error.pyx", line 336, in av.error.err_check
av.error.ExitError: [Errno 1414092869] Immediate exit requested: 'udp://@0.0.0.0:11111'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Roman\dronecur\dronecur\Basic.py", line 11, in <module>
img = me.get_frame_read().frame
File "C:\Users\Roman\dronecur\dronecur\venv\lib\site-packages\djitellopy\enforce_types.py", line 54, in wrapper
return func(*args, **kwargs)
File "C:\Users\Roman\dronecur\dronecur\venv\lib\site-packages\djitellopy\tello.py", line 421, in get_frame_read
self.background_frame_read = BackgroundFrameRead(self, address, with_queue, max_queue_len)
File "C:\Users\Roman\dronecur\dronecur\venv\lib\site-packages\djitellopy\tello.py", line 1051, in __init__
raise TelloException('Failed to grab video frames from video stream')
djitellopy.tello.TelloException: Failed to grab video frames from video stream
[INFO] tello.py - 438 - Send command: 'streamoff'