From c1b7c7c3afaa2f902d5516e4111aac38d6b4ae37 Mon Sep 17 00:00:00 2001 From: raiot Date: Thu, 6 Jun 2024 18:43:28 +0800 Subject: [PATCH] init --- main.py | 21 +++++++++++++++++++++ picture.png | Bin 0 -> 941 bytes video.avi | Bin 0 -> 7172 bytes 3 files changed, 21 insertions(+) create mode 100644 main.py create mode 100644 picture.png create mode 100644 video.avi diff --git a/main.py b/main.py new file mode 100644 index 0000000..98a00e0 --- /dev/null +++ b/main.py @@ -0,0 +1,21 @@ +from djitellopy import Tello +import cv2 + +my_drone = Tello() +my_drone.connect() +print(my_drone.get_battery()) +my_drone.streamon() +my_drone.set_video_direction(Tello.CAMERA_DOWNWARD) +while True: + # Read a frame from the video stream + img = my_drone.get_frame_read().frame + img = cv2.resize(img, (360, 240)) + # Display the frame + cv2.imshow("Image", img) + # Check for key press to exit + if cv2.waitKey(1) & 0xFF == ord('q'): + break + +cv2.destroyAllWindows() +my_drone.streamoff() +# my_drone.land() \ No newline at end of file diff --git a/picture.png b/picture.png new file mode 100644 index 0000000000000000000000000000000000000000..4404e7dabb5bd7ed4734d6a3b10f91ba1051ac16 GIT binary patch literal 941 zcmeAS@N?(olHy`uVBq!ia0y~yV4MKNIvh+uk)*3dQyCbTOFUg1Ln;{G9%SSM3NkJD zRliHN@fO3J3zopr0RL(is{jB1 literal 0 HcmV?d00001 diff --git a/video.avi b/video.avi new file mode 100644 index 0000000000000000000000000000000000000000..0ada87377c03c0f5b2d91a24a9cb33c8e4eaee0d GIT binary patch literal 7172 zcmWIYbaVS7&A{Lo=BeQ0865IPkbxm1r6?z{EHlG`fq}uaiGg9kZeAdZfkA+ifq@Ck zVqjo|h%ih5GISsus0@SxnKea#fuXphC=4N_^1_lhE(E7oQ&x}#I(GVC7f#Dhgpb}ye zaF8`Ozbq3pk_sB31&;r202ZK(TRVjzL&1y+3`cr97{2nfs7?WnwK8r3mLbW&GQ`l> z1YC$PFm7fLU!ox5k^opD)-ixeSZ8om q!niHqgE43-j7)H!Av2}IPyuKb$V}jL7ea!_t6kkX-