視頻補捉-tello
視頻補捉-tello
tello函式
Get_frame_read(self)
從攝像頭無人機獲取 BackgroundFrameRead 對象。然後,您只需要調用 backgroundFrameRead.frame 來獲取無人機接收到的實際幀。
從攝像頭無人機獲取 BackgroundFrameRead 對象。然後,您只需要調用 backgroundFrameRead.frame 來獲取無人機接收到的實際幀。
Get_frame_read(self).frame使用 backgroundFrameRead.frame 獲取當前幀。
程式
import cv2
from djitellopy import tello
mytello = tello.Tello()
mytello.connect()
print("電池格數剩: {}%".format(mytello.get_battery()))
#如果視頻打不開opencv降版本opencv-python 4.5.1.48
mytello.streamon()
while True:
img = mytello.get_frame_read().frame
img = cv2.resize(img, (360, 240)) #視窗大小的設定
cv2.imshow("Image", img)
cv2.waitKey(1)
留言
張貼留言