ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
AI ?? ?????
? ? ?
jhkim3217@gmail.com
2024. 2.
????? ??
?? ??
? DJI Tello ?? ??
? ??? ??, ????, Tello ?? ????(HW, SW) ?
? ?? ?? ??? ?? ?? ?? ??
? ?? ??? ?? ? ?
? Tello SDK? ??? ??? ??(1)
? DJITelloPy ??
? ?? ?? ??
? takeoff, land, up/down, forward/backward, cw/ ccw ?
? ??? ??
? Tello SDK? ??? ??? ??(2)
? OpenCV ??
? ?? ??? ??? ?? ? ??
? ?? ??? ?? ? ??
? ??? ?? AI ?? ??
? Cascade Classifier? ??? ?? ??
? ?? ??
? following me ?? ??
? ? ???? : ???? AI ?? ??
Tello Drone ?? ??
Tello Drone ?? ??
Tello ?? ??
?? : https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20User%20Manual%20v1.4.pdf
????/ ??
????/ ??
??? ?? ?? : Quadcopter
Tello ?? ?? ?
Tello ?? ?? ?
? Tello ??? ??? : https://bit.ly/3ygby6T
Tello ?? ?? ?
? Tello ??? ??? : https://bit.ly/3ygby6T
Tello ?? ?? ?
? Tello ??? ??? : https://bit.ly/3ygby6T
Tello ?? ?? ?
? Tello ??? ??? : https://bit.ly/3ygby6T
Tello ?? ?? ?
? Tello ??? ??? : https://bit.ly/3ygby6T
??01 : ?? ? ????
Tello SDK? ???
??? ??(1)
??? ??
? ??? ?? ??? : https://www.python.org/
? ??? 3.7 ~ 3.8 ????
???(??? ??????) ??
? Pycharm Edu ???? ? ??
? https://www.jetbrains.com/ko-kr/pycharm-edu/
??? ????
? https://blog.dalso.org/language/python/13534
??? ?? ?????
? Python Basics ????
? https://bit.ly/3yiBxxz
Code:
print('Hello World')
myData = 'Hello World'
print(len(myData))
print(type(myData))
Result:
Hello World
11
<class 'str'>
DJITelloPy ??
? API : djitellopy.readthedocs.io
? GitHub : https://github.com/damiafuentes/DJITelloPy
? DJITelloPy ?? ??
? ???
? pip install djitellopy==2.4.0
? ???
? [setting]->[Project]->[Python Interpreter] -> + ¡®djitellopy 2.4.0¡¯
DJITelloPy ?? API :
https://djitellopy.readthedocs.io/en/latest/tello/
?? ?? ??
? takeoff/ land
? takeoff(), land()
? move up/ down
? move_up(), move_down()
? move left/ right
? move_left(), move_right()
? rotate_cw_ccw
? rotate_clockwise(), rotate_counter_clockwise()
? send_rc_control_async
? send_rc_control(self, left_right_velocity, forward_backward_velocity, up_down_velocity,
yaw_velocity)
?? 01
? takeoff -> landing
from djitellopy import Tello
import time
print("Create Tello object")
tello = Tello()
print("Connect to Tello Drone")
tello.connect()
battery_level = tello.get_battery()
print(f"Battery Life Percentage: {battery_level}")
print("Takeoff!")
tello.takeoff()
print("Sleep for 5 seconds")
time.sleep(5)
print("landing")
tello.land()
print("touchdown.... goodbye")
?? 02
? takeoff -> 3? up(40) -> down(40) ?? -> landing
?? 03
? takeoff -> fwd(40) -> fwd(40) -> fwd(40) -> cw(180)
-> fwd(40) -> fwd(40) -> fwd(40) -> land
from djitellopy import Tello
tello = Tello()
tello.connect()
tello.takeoff()
tello.move_left(100)
tello.rotate_clockwise(90)
tello.move_forward(100)
tello.land()
? ??
??? ???? : for in range()
from djitellopy import Tello
myTello = Tello()
myTello.connect()
myTello.takeoff()
for i in range (0,3) :
myTello.move_up(30)
myTello.rotate_counter_clockwise(90)
myTello.move_down(30)
myTello.land()
from djitellopy import
Tello
myTello = Tello()
myTello.connect()
myTello.takeoff()
myTello.move_up(30)
myTello.move_down(30)
myTello.move_up(50)
myTello.move_down(50)
myTello.move_up(50)
myTello.move_down(50)
myTello.land()
??? ?? ???? : def
from djitellopy import
Tello
myTello = Tello()
myTello.connect()
myTello.takeoff()
myTello.move_up(30)
myTello.move_down(30)
myTello.move_up(30)
myTello.move_down(30)
myTello.move_up(30)
myTello.move_down(30)
myTello.land()
def move_up_down(t):
myTello.move_up(t)
myTello.move_down(t)
for i in range(3):
t = 30
move_up_down(t)
?? 04
? takeoff -> fwd(40) -> fwd(40) -> fwd(40) -> cw(180)
-> fwd(40) -> fwd(40) -> fwd(40) -> cw(180) -> land
? fwd(40)? ????? ??? ??
input() ??? ??? ?? ??
from djitellopy import tello
myTello = tello.Tello()
myTello.connect()
battery_level = tello.get_battery()
print(battery_level)
while True:
command = int(input("Enter Command!"))
print(command, end="n")
if (command == 1):
myTello.takeoff()
elif (command == 2):
myTello.move_up(30)
elif (command == 3):
myTello.move_down(30)
elif (command == 4):
myTello.land()
else:
break
print("Drone mission completed!")
?? 05 : input() ??? ??? ?? ??? ???
1. Takeoff()
2. move_up(20)
3. move_down(20)
4. move_left(20)
5. move_right(20)
6. move_forward(20)
7. move_backward(20)
8. rotate_clockwise(90)
9. rotate_counter_clockwose(90)
10. flip_back()
11. flip_forward()
12. flip_left()
13. flip_right()
14. land()
?? 06 : cross flight ??
?? 06 : cross flight ??
from djitellopy import Tello
import time
print("Create Tello object")
tello = Tello()
print("Connect to Tello Drone")
tello.connect()
battery_level = tello.get_batte
ry()
print(battery_level)
print("Takeoff!")
tello.takeoff()
time.sleep(1)
travel_distance_cm = 50
#tello.go_xyz_speed(x,y,z, speed)
# x - (+)foward/(-)backwards
# y - (+)left/(-)right
# z - (+)up/(-)down
tello.go_xyz_speed(0, 0, travel_distance_cm, 20)
print("sleep")
time.sleep(0.5)
tello.go_xyz_speed(0, travel_distance_cm, -travel_distanc
e_cm, 20)
print("sleep")
time.sleep(0.5)
tello.go_xyz_speed(0, 0, travel_distance_cm, 20)
print("sleep")
time.sleep(0.5)
# x - (+)foward/(-)backwards
# y - (+)left/(-)right
# z - (+)up/(-)down
tello.go_xyz_speed(0, -travel_distance_cm, -travel_distan
ce_cm, 20)
print("sleep")
time.sleep(0.5)
print("landing")
Opencv? ???
??? ???, ??? ??
https://opencv.org/
?? ?? ??, ????
import cv2
from djitellopy import Tello
tello = Tello()
tello.connect()
tello.streamon()
frame_read = tello.get_frame_read()
tello.takeoff()
cv2.imwrite("picture.png", frame_read.frame)
tello.land()
?? ??? ??, ??
from djitellopy import tello
import cv2
import time
tello = tello.Tello()
tello.connect()
battery_level = tello.get_battery()
print(f"Battery Life Percentage: {battery_level}")
time.sleep(2)
print("Turn Video Stream On")
tello.streamon()
# read a single image from the Tello video feed
print("Read Tello Image")
frame_read = tello.get_frame_read()
print(type(frame_read))
time.sleep(2)
while True:
# read a single image from the Tello video feed
print("Read Tello Image")
tello_video_image = frame_read.frame
# use opencv to write image
if tello_video_image is not None:
cv2.imshow("TelloVideo", tello_video_image)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
tello.streamoff()
cv2.destroyWindow('TelloVideo')
cv2.destroyAllWindows()
?? ??? ????
? manual-control-opencv
from djitellopy import Tello
import cv2, math, time
tello = Tello()
tello.connect()
tello.streamon()
frame_read = tello.get_frame_read()
while True:
img = frame_read.frame
cv2.imshow("drone", img)
key = cv2.waitKey(1) & 0xff
if key == 27: # ESC
break
elif key == ord('t'):
tello.takeoff()
elif key == ord('w'):
tello.move_forward(30)
elif key == ord('s'):
tello.move_back(30)
elif key == ord('a'):
tello.move_left(30)
elif key == ord('d'):
tello.move_right(30)
elif key == ord('e'):
tello.rotate_clockwise(30)
elif key == ord('q'):
tello.rotate_counter_clockwise(30)
elif key == ord('r'):
tello.move_up(30)
elif key == ord('f'):
tello.move_down(30)
tello.land()
cv2.destroyAllWindows()
?? 04
? ¡®?? ??? ????¡¯? ?? ??? ??, PC ??? ???
? PC?? ??? ???? ?? ??? ????
? cv2.VideoCapture(0)
? ret, frame = cap.read()
? cv2.imshow(¡°Video¡±, frame)
? https://github.com/DIT-AI-Drone-
Course/SOURCE/blob/main/take_picture_opencv.py
Tello SDK? ???
??? ??(2)
Opencv ??
? https://opencv.org/
? % pip install opencv-python ?? ??? add(+) opencv-python
??? Opencv ?? ??
? ???
? ?? -> ???? -> Python ????? -> + -> opencv-python
?? ?? ??, ????
import cv2
from djitellopy import Tello
battery_level = tello.get_battery()
print(battery_level)
tello = Tello()
tello.connect()
tello.streamon()
frame_read = tello.get_frame_read()
tello.takeoff()
cv2.imwrite("picture.png",
frame_read.frame)
tello.land()
Opencv? ?? ??? ??, ??
from djitellopy import tello
import cv2
import time
tello = tello.Tello()
tello.connect()
battery_level = tello.get_battery()
print(battery_level)
print("Turn Video Stream On")
tello.streamon()
time.sleep(2)
while True:
# read a single image from the Tello video feed
frame_read = tello.get_frame_read()
tello_video_image = frame_read.frame
# ??? ?? ?? ¡° resize()
image = cv2.resize(tello_video_image, (360, 240))
# use opencv to write image
if image is not None:
cv2.imshow("TelloVideo", image)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
tello.streamoff()
cv2.destroyWindow('TelloVideo')
cv2.destroyAllWindows()
?? ??? ??, ?? : Opencv ??? ??
from djitellopy import tello
import cv2
import time
tello = tello.Tello()
tello.connect()
battery_level =
tello.get_battery()
print(battery_level)
time.sleep(2)
tello.streamon()
frame_read =
tello.get_frame_read()
while True:
frame = frame_read.frame
frame = cv2.resize(frame, (360*2, 240*2)) # ??? ??
??
while True:
frame = frame_read.frame
if frame is not None:
cv2.imshow("TelloVideo", frame)
k = cv2.waitKey(5) & 0xFF
if k == ord('q'):
break
elif k == ord('t'):
tello.takeoff()
elif k == ord('u'):
tello.move_up(50)
elif k == ord('c'):
tello.rotate_clockwise(360)
elif k == ord('l'):
tello.land()
else :
print(¡®no key!!!¡¯)
tello.streamoff()
cv2.destroyWindow('TelloVideo')
cv2.destroyAllWindows()
Opencv? ?? ??? ????
? manual-control-opencv
from djitellopy import Tello
import cv2, time
tello = Tello()
tello.connect()
battery_level = tello.get_battery()
print(battery_level)
tello.streamon()
frame_read = tello.get_frame_read()
frame = cv2.resize(frame, (360*2, 240*2))
while True:
img = frame_read.frame
cv2.imshow("drone", img)
key = cv2.waitKey(1) & 0xff
if key == ord(¡®q¡¯):
break
elif key == ord('t'):
tello.takeoff()
elif key == ord(¡®f'):
tello.move_forward(30)
elif key == ord(¡®b'):
tello.move_back(30)
elif key == ord(¡®l'):
tello.move_left(30)
elif key == ord(¡®r'):
tello.move_right(30)
elif key == ord(¡®c'):
tello.rotate_clockwise(30)
elif key == ord(¡®r'):
tello.rotate_counter_clockwise(30)
elif key == ord(¡®u'):
tello.move_up(30)
elif key == ord(¡®d'):
tello.move_down(30)
tello.streamoff()
cv2.destroyWindow(¡®drone')
cv2.destroyAllWindows()
? ?? ?? :
https://github.com/damiafuentes/DJITelloPy/
blob/master/examples/manual-control-opencv.py
??? ??/?? ??? ??? ???? : ???(Thread)
import time, cv2
from threading import Thread
from djitellopy import Tello
tello = Tello()
tello.connect()
battery_level = tello.get_battery()
print(battery_level)
keepRecording = True
tello.streamon()
frame_read = tello.get_frame_read()
def videoRecorder():
height, width, _ = frame_read.frame.shape
# create a VideoWrite object, recoring to ./video.avi
video = cv2.VideoWriter('video3.avi', cv2.VideoWriter_fourcc(*'XVID'), 30, (width, height))
while keepRecording:
tello_video_image = frame_read.frame
tello_video_image = cv2.resize(tello_video_image, (360 * 2, 240 * 2))
# PC? Tello ?? ??? ??
video.write(frame_read.frame)
if tello_video_image is not None:
cv2.imshow('video', tello_video_image)
time.sleep(1 / 30)
if cv2.waitKey(1) & 0xFF == ord('q'):
cv2.destroyWindow('video')
cv2.destroyAllWindows()
# we need to run the recorder in a seperate thread
recorder = Thread(target=videoRecorder)
recorder.start()
tello.takeoff()
tello.move_up(30)
tello.rotate_counter_clockwise(360)
tello.land()
keepRecording = False
recorder.join()
? ?? ?? ???? : https://drive.google.com/file/d/1jZD-DjCZK8cVg1r-20hhr4-RcYzW9-5-/view?usp=sharing
??? ?? AI ?? ??
Opencv Face Detection
? pre-training model ????
? https://github.com/opencv/opencv/blob/master/data/haarcascades
?? ???? : Cascade Classifier
?? ???? : Cascade Classifier
import cv2
from djitellopy import tello
tello = tello.Tello()
tello.connect()
battery_level = tello.get_battery()
print(battery_level)
tello.streamon()
while True:
img = tello.get_frame_read().frame
img = cv2.resize(img, (360*2, 240*2))
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(imgGray, 1.3, 5)
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2)
cv2.imshow('frame',img)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
tello.streamoff()
cv2.destroyAllWindows()
?? ???? : Cascade Classifier
import cv2
from djitellopy import tello
tello = tello.Tello()
tello.connect()
battery_level = tello.get_battery()
print(battery_level)
tello.streamon()
while True:
img = tello.get_frame_read().frame
img = cv2.resize(img, (360, 240))
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(imgGray, 1.2, 8)
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2)
cx = x + w // 2
cy = y + h // 2
area = w * h
cv2.circle(img, (cx, cy), 5, (0, 255, 0), cv2.FILLED)
print('area =', area)
cv2.imshow('frame',img)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
* ?? ?? : https://drive.google.com/file/d/1jZLuuovY-tWJdwy1LYD4knpCQkvAjzxk/view?usp=sharing
* haarcascade_frontalface_default.xml ?? : https://drive.google.com/file/d/1j_Hjo0N6v0HtL1F55ekFBbQ6yxKT3SrQ/view?usp=sharing
?? ?? ??? ??? ??? ???
Face Tracking ?? ??
? back, forward
? ccw, cw
? up, down
??? AI ?? ?????
??? ?? ???(cx, cy)? ?? ??? ???(tcx, tcy) ??
import cv2
from djitellopy import tello
tello = tello.Tello()
tello.connect()
battery_level = tello.get_battery()
print(battery_level)
tello.streamon()
while True:
img = tello.get_frame_read().frame
img = cv2.resize(img, (360*2, 240*2))
faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml")
imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiScale(imgGray, 1.3, 5)
if len(faces) == 1:
print("face found")
print('faces', faces)
else:
print("face not found")
# ?? ??? ???(center)
tcx = 360
tcy = 240
cv2.circle(img, (tcx, tcy), 10, (255, 0, 0), cv2.FILLED)
# ??? ?? ??? ?? ???
for (x, y, w, h) in faces:
cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2)
cx = x + w // 2
cy = y + h // 2
area = w * h
cv2.circle(img, (cx, cy), 10, (0, 255, 0), cv2.FILLED)
print('area =', area)
# ?? ??? ??? ?? ??? ?? ?? ? ????
cv2.line(img, (cx, cy), (tcx, tcy), (255, 0, 0), 2)
cv2.imshow('frame',img)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
tello.streamoff()
cv2.destroyAllWindows()
forward/ backward ??
# ?? ??? ?? : z_area = offset_z
offset_z = w * h
# ?? ??? ?? update ? forward/ backward ??
def adjust_tello_position(offsetz):
f not 15000 <= offset_z <= 30000 and offset_z != 0:
if offset_z < 15000:
tello.move_forward(20)
elif offset_z > 30000:
tello.move_back(20)
?? ?? : https://drive.google.com/file/d/1fJn9bOhB9cEKs71fDCtqzvWxQfNcb4z5/view?usp=sharing
left/ right ??
offset_x = face_center_x - center_x
def adjust_tello_position(offset_x):
"""
Adjusts the position of the tello drone based on the offset values given from th
e frame
:param offset_x: Offset between center and face x coordinates
"""
if not -90 <= offset_x <= 90 and offset_x != 0:
# offset_x? ???? ?? ?? ???? ?? ?? ?? ??
if offset_x < 0:
tello.rotate_counter_clockwise(10)
# offset_x? ???? ?? ???? ?? ?? ?? ??
elif offset_x > 0:
tello.rotate_clockwise(10)
?? ?? : https://drive.google.com/file/d/1WXTTag3aDv66SXSCYzapRxOcCA3PNnSK/view?usp=sharing
up/ down ??
# Add 30 so that the drone covers as much of the subject as possible
offset_y = face_center_y - center_y - 30
"""
Adjusts the position of the tello drone based on the offset values given
from the frame
:param offset_y: Offset between center and face y coordinates
"""
if not -70 <= offset_y <= 70 and offset_y != -30:
if offset_y < 0:
print('move up')
tello.move_up(20)
elif offset_y > 0:
print('move down')
tello.move_down(20)
?? ?? : https://drive.google.com/file/d/1WXTTag3aDv66SXSCYzapRxOcCA3PNnSK/view?usp=sharing
Face following ??
?? ?? : https://drive.google.com/file/d/1f4Xcq8W4HL7tRSILb-hXrV9Jd-gywPPp/view?usp=sharing
Face Detection AI ????
? Haar Cascade
? https://github.com/opencv/opencv/blob/master/data/haarcascades/haarcas
cade_frontalface_default.xml
? Dlib : HOG + CNN
? https://github.com/davisking/dlib
? MTCNN
? https://github.com/ipazc/mtcnn
? OpenCV DNN : Caffe based DNN
? https://github.com/opencv/opencv/tree/master/samples/dnn/face_detector
? YOLO
? https://velog.io/@hhhong/Object-Detection-with-YOLO
AI ?? ????
? PID ??
? https://github.com/ivmech/ivPID
? Custom ?? ???
? ????(fine tuning)
? PoseNet
? ??? ?? ??
? Dlib
? facial landmark ??
? YOLO
? ??? ?? ??
? ??? ?? ?? ??
? MediaPipe
? https://google.github.io/mediapipe/
?? ??
? https://www.youtube.com/watch?v=LmEcyQnfpDA&t=3576s
? https://github.com/juanmapf97/Tello-Face-Recognition
? https://google.github.io/mediapipe/
? https://www.droneblocks.io/

More Related Content

What's hot (20)

Exploiting Deserialization Vulnerabilities in Java
Exploiting Deserialization Vulnerabilities in JavaExploiting Deserialization Vulnerabilities in Java
Exploiting Deserialization Vulnerabilities in Java
CODE WHITE GmbH
?
FIDO and the Future of User Authentication
FIDO and the Future of User AuthenticationFIDO and the Future of User Authentication
FIDO and the Future of User Authentication
FIDO Alliance
?
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
?
Launching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT ProjectsLaunching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT Projects
Vincent Claes
?
Hackfest presentation.pptx
Hackfest presentation.pptxHackfest presentation.pptx
Hackfest presentation.pptx
Peter Yaworski
?
ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)
ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)
ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)
Jeff Chu
?
Fortify On Demand and ShadowLabs
Fortify On Demand and ShadowLabsFortify On Demand and ShadowLabs
Fortify On Demand and ShadowLabs
jasonhaddix
?
API documentation
API documentationAPI documentation
API documentation
Anindita Basu
?
When Should I Use Simulation?
When Should I Use Simulation?When Should I Use Simulation?
When Should I Use Simulation?
SIMUL8 Corporation
?
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk
Simon Bennetts
?
Cypress
CypressCypress
Cypress
Jonathan de Britto Sedrez
?
OSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ InfosectrainOSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ Infosectrain
InfosecTrain
?
Spring Security
Spring SecuritySpring Security
Spring Security
Sumit Gole
?
Using the Splunk Java SDK
Using the Splunk Java SDKUsing the Splunk Java SDK
Using the Splunk Java SDK
Damien Dallimore
?
Java Code Review Checklist
Java Code Review ChecklistJava Code Review Checklist
Java Code Review Checklist
Mahesh Chopker
?
TestCafe Meetup Malmberg
TestCafe Meetup MalmbergTestCafe Meetup Malmberg
TestCafe Meetup Malmberg
Joost van Dieten
?
Managing Microservices With The Istio Service Mesh on Kubernetes
Managing Microservices With The Istio Service Mesh on KubernetesManaging Microservices With The Istio Service Mesh on Kubernetes
Managing Microservices With The Istio Service Mesh on Kubernetes
Iftach Schonbaum
?
Postman
PostmanPostman
Postman
Igor Shubovych
?
Agile test-management-test-rail-lastest
Agile test-management-test-rail-lastestAgile test-management-test-rail-lastest
Agile test-management-test-rail-lastest
Onur Baskirt
?
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
Suresh Patidar
?
Exploiting Deserialization Vulnerabilities in Java
Exploiting Deserialization Vulnerabilities in JavaExploiting Deserialization Vulnerabilities in Java
Exploiting Deserialization Vulnerabilities in Java
CODE WHITE GmbH
?
FIDO and the Future of User Authentication
FIDO and the Future of User AuthenticationFIDO and the Future of User Authentication
FIDO and the Future of User Authentication
FIDO Alliance
?
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
Peter Lubbers
?
Launching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT ProjectsLaunching Python Cloud Services for AI/IoT Projects
Launching Python Cloud Services for AI/IoT Projects
Vincent Claes
?
Hackfest presentation.pptx
Hackfest presentation.pptxHackfest presentation.pptx
Hackfest presentation.pptx
Peter Yaworski
?
ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)
ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)
ASP.NET é_°lȈT²»¿É²»ÖªµÄ IIS (IIS for ASP.NET Developers)
Jeff Chu
?
Fortify On Demand and ShadowLabs
Fortify On Demand and ShadowLabsFortify On Demand and ShadowLabs
Fortify On Demand and ShadowLabs
jasonhaddix
?
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk
Simon Bennetts
?
OSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ InfosectrainOSCP Preparation Guide @ Infosectrain
OSCP Preparation Guide @ Infosectrain
InfosecTrain
?
Java Code Review Checklist
Java Code Review ChecklistJava Code Review Checklist
Java Code Review Checklist
Mahesh Chopker
?
Managing Microservices With The Istio Service Mesh on Kubernetes
Managing Microservices With The Istio Service Mesh on KubernetesManaging Microservices With The Istio Service Mesh on Kubernetes
Managing Microservices With The Istio Service Mesh on Kubernetes
Iftach Schonbaum
?
Agile test-management-test-rail-lastest
Agile test-management-test-rail-lastestAgile test-management-test-rail-lastest
Agile test-management-test-rail-lastest
Onur Baskirt
?
Web worker in your angular application
Web worker in your angular applicationWeb worker in your angular application
Web worker in your angular application
Suresh Patidar
?

Similar to ??? AI ?? ????? (20)

AI ?? ?????
AI ?? ?????AI ?? ?????
AI ?? ?????
JongHyunKim78
?
Vue.js ?? ??.pptx
Vue.js ?? ??.pptxVue.js ?? ??.pptx
Vue.js ?? ??.pptx
wonyong hwang
?
Airflow? ??? ??? Workflow ??
Airflow? ???  ??? Workflow ??Airflow? ???  ??? Workflow ??
Airflow? ??? ??? Workflow ??
YoungHeon (Roy) Kim
?
??? ???? ??? ?? 2015. 3.28.
??? ???? ??? ?? 2015. 3.28.??? ???? ??? ?? 2015. 3.28.
??? ???? ??? ?? 2015. 3.28.
chcbaram
?
Unity?????????
Unity?????????Unity?????????
Unity?????????
Changwon National University
?
Meteor React Tutorial ????
Meteor React Tutorial ????Meteor React Tutorial ????
Meteor React Tutorial ????
Jiam Seo
?
Python on Android
Python on AndroidPython on Android
Python on Android
? ?
?
Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706
Yong Joon Moon
?
Processing+Open Cv
Processing+Open CvProcessing+Open Cv
Processing+Open Cv
Chrissung
?
??? ?????, ???? ??
??? ?????, ???? ????? ?????, ???? ??
??? ?????, ???? ??
Arawn Park
?
I phone 2 release
I phone 2 releaseI phone 2 release
I phone 2 release
Jaehyeuk Oh
?
[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...
[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...
[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...
Seok-joon Yun
?
11? ??? ??? ? + 12? ???
11? ??? ??? ? + 12? ???11? ??? ??? ? + 12? ???
11? ??? ??? ? + 12? ???
?? ?
?
11? ??? ??? ?
11? ??? ??? ?11? ??? ??? ?
11? ??? ??? ?
?? ?
?
[1B4]??????????? ????????_???????????
[1B4]??????????? ????????_???????????[1B4]??????????? ????????_???????????
[1B4]??????????? ????????_???????????
NAVER D2
?
[143] Modern C++ ??? ?? ??
[143] Modern C++ ??? ?? ??[143] Modern C++ ??? ?? ??
[143] Modern C++ ??? ?? ??
NAVER D2
?
Web Components 101 polymer & brick
Web Components 101 polymer & brickWeb Components 101 polymer & brick
Web Components 101 polymer & brick
yongwoo Jeon
?
????? ???? with TensorFlow
????? ???? with TensorFlow????? ???? with TensorFlow
????? ???? with TensorFlow
Jang Hoon
?
[Flutter Meetup In Songdo] ?????????? ????????? ????
[Flutter Meetup In Songdo] ?????????? ????????? ????[Flutter Meetup In Songdo] ?????????? ????????? ????
[Flutter Meetup In Songdo] ?????????? ????????? ????
SuJang Yang
?
[??] ??? ?? [2015.5.23]
[??] ??? ?? [2015.5.23][??] ??? ?? [2015.5.23]
[??] ??? ?? [2015.5.23]
chcbaram
?
??? ???? ??? ?? 2015. 3.28.
??? ???? ??? ?? 2015. 3.28.??? ???? ??? ?? 2015. 3.28.
??? ???? ??? ?? 2015. 3.28.
chcbaram
?
Meteor React Tutorial ????
Meteor React Tutorial ????Meteor React Tutorial ????
Meteor React Tutorial ????
Jiam Seo
?
Python on Android
Python on AndroidPython on Android
Python on Android
? ?
?
Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706Jupyter notebok tensorboard ????_20160706
Jupyter notebok tensorboard ????_20160706
Yong Joon Moon
?
Processing+Open Cv
Processing+Open CvProcessing+Open Cv
Processing+Open Cv
Chrissung
?
??? ?????, ???? ??
??? ?????, ???? ????? ?????, ???? ??
??? ?????, ???? ??
Arawn Park
?
[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...
[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...
[C++ Korea] Effective Modern C++ mva item 7 distinguish between and {} when c...
Seok-joon Yun
?
11? ??? ??? ? + 12? ???
11? ??? ??? ? + 12? ???11? ??? ??? ? + 12? ???
11? ??? ??? ? + 12? ???
?? ?
?
11? ??? ??? ?
11? ??? ??? ?11? ??? ??? ?
11? ??? ??? ?
?? ?
?
[1B4]??????????? ????????_???????????
[1B4]??????????? ????????_???????????[1B4]??????????? ????????_???????????
[1B4]??????????? ????????_???????????
NAVER D2
?
[143] Modern C++ ??? ?? ??
[143] Modern C++ ??? ?? ??[143] Modern C++ ??? ?? ??
[143] Modern C++ ??? ?? ??
NAVER D2
?
Web Components 101 polymer & brick
Web Components 101 polymer & brickWeb Components 101 polymer & brick
Web Components 101 polymer & brick
yongwoo Jeon
?
????? ???? with TensorFlow
????? ???? with TensorFlow????? ???? with TensorFlow
????? ???? with TensorFlow
Jang Hoon
?
[Flutter Meetup In Songdo] ?????????? ????????? ????
[Flutter Meetup In Songdo] ?????????? ????????? ????[Flutter Meetup In Songdo] ?????????? ????????? ????
[Flutter Meetup In Songdo] ?????????? ????????? ????
SuJang Yang
?
[??] ??? ?? [2015.5.23]
[??] ??? ?? [2015.5.23][??] ??? ?? [2015.5.23]
[??] ??? ?? [2015.5.23]
chcbaram
?

More from Jong-Hyun Kim (20)

Google Teachable machine? ??? AI ??? ???
Google Teachable machine? ???  AI ??? ???Google Teachable machine? ???  AI ??? ???
Google Teachable machine? ??? AI ??? ???
Jong-Hyun Kim
?
??? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ??
??? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ????? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ??
??? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ??
Jong-Hyun Kim
?
????????? AI ?? ?? ? ??
????????? AI ?? ?? ? ??????????? AI ?? ?? ? ??
????????? AI ?? ?? ? ??
Jong-Hyun Kim
?
Edge AI ? ?? ???? ??
Edge AI ? ?? ???? ??Edge AI ? ?? ???? ??
Edge AI ? ?? ???? ??
Jong-Hyun Kim
?
?? ???? IT?? ??? ?.???? ?? ?? ??
?? ???? IT?? ??? ?.???? ?? ?? ???? ???? IT?? ??? ?.???? ?? ?? ??
?? ???? IT?? ??? ?.???? ?? ?? ??
Jong-Hyun Kim
?
Busan Citizen Censor : ?? ?? ?? ????? ????? ???
Busan Citizen Censor : ?? ?? ?? ????? ????? ??? Busan Citizen Censor : ?? ?? ?? ????? ????? ???
Busan Citizen Censor : ?? ?? ?? ????? ????? ???
Jong-Hyun Kim
?
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
Jong-Hyun Kim
?
?? ???(EV) ??? ????? ??? ? ??
?? ???(EV) ??? ????? ??? ? ?? ?? ???(EV) ??? ????? ??? ? ??
?? ???(EV) ??? ????? ??? ? ??
Jong-Hyun Kim
?
micro:bit ????? ??
micro:bit ????? ?? micro:bit ????? ??
micro:bit ????? ??
Jong-Hyun Kim
?
??? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ???
??? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ?????? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ???
??? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ???
Jong-Hyun Kim
?
???? ??? ?? ??? ??? IoT ??? ??
???? ??? ?? ??? ??? IoT ??? ?????? ??? ?? ??? ??? IoT ??? ??
???? ??? ?? ??? ??? IoT ??? ??
Jong-Hyun Kim
?
?? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ??
?? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ???? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ??
?? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ??
Jong-Hyun Kim
?
???? ??? ??? IoT ??? ? ??
???? ??? ??? IoT ??? ? ?????? ??? ??? IoT ??? ? ??
???? ??? ??? IoT ??? ? ??
Jong-Hyun Kim
?
???? ?? ??? IoT ?????
???? ?? ??? IoT ????????? ?? ??? IoT ?????
???? ?? ??? IoT ?????
Jong-Hyun Kim
?
?????? ?? ??
?????? ?? ???????? ?? ??
?????? ?? ??
Jong-Hyun Kim
?
???? ?? ?? ???? ?? : ???? ??? ??
???? ?? ?? ???? ?? : ???? ??? ?????? ?? ?? ???? ?? : ???? ??? ??
???? ?? ?? ???? ?? : ???? ??? ??
Jong-Hyun Kim
?
??? ?? ????? ?? : ????? ???? ?? ???? SW??? ??
??? ?? ????? ?? : ????? ???? ?? ????  SW??? ????? ?? ????? ?? : ????? ???? ?? ????  SW??? ??
??? ?? ????? ?? : ????? ???? ?? ???? SW??? ??
Jong-Hyun Kim
?
???????????? ????????? ??????
???????????? ????????? ?????????????????? ????????? ??????
???????????? ????????? ??????
Jong-Hyun Kim
?
????? ??????????? ?????????? ???? SW ?? ????
????? ??????????? ?????????? ???? SW ?? ????????? ??????????? ?????????? ???? SW ?? ????
????? ??????????? ?????????? ???? SW ?? ????
Jong-Hyun Kim
?
????????? ?????? ????????? ?????
????????? ?????? ????????? ?????????????? ?????? ????????? ?????
????????? ?????? ????????? ?????
Jong-Hyun Kim
?
Google Teachable machine? ??? AI ??? ???
Google Teachable machine? ???  AI ??? ???Google Teachable machine? ???  AI ??? ???
Google Teachable machine? ??? AI ??? ???
Jong-Hyun Kim
?
??? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ??
??? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ????? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ??
??? AI ?? : ? ? ? ? ? ???? ??? ?? ?? AI ??
Jong-Hyun Kim
?
????????? AI ?? ?? ? ??
????????? AI ?? ?? ? ??????????? AI ?? ?? ? ??
????????? AI ?? ?? ? ??
Jong-Hyun Kim
?
?? ???? IT?? ??? ?.???? ?? ?? ??
?? ???? IT?? ??? ?.???? ?? ?? ???? ???? IT?? ??? ?.???? ?? ?? ??
?? ???? IT?? ??? ?.???? ?? ?? ??
Jong-Hyun Kim
?
Busan Citizen Censor : ?? ?? ?? ????? ????? ???
Busan Citizen Censor : ?? ?? ?? ????? ????? ??? Busan Citizen Censor : ?? ?? ?? ????? ????? ???
Busan Citizen Censor : ?? ?? ?? ????? ????? ???
Jong-Hyun Kim
?
IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019IoT Hands-On-Lab, KINGS, 2019
IoT Hands-On-Lab, KINGS, 2019
Jong-Hyun Kim
?
?? ???(EV) ??? ????? ??? ? ??
?? ???(EV) ??? ????? ??? ? ?? ?? ???(EV) ??? ????? ??? ? ??
?? ???(EV) ??? ????? ??? ? ??
Jong-Hyun Kim
?
??? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ???
??? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ?????? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ???
??? ??(Porbe Vehicle)? ??? IoT ?? ??? ?? ???? ???
Jong-Hyun Kim
?
???? ??? ?? ??? ??? IoT ??? ??
???? ??? ?? ??? ??? IoT ??? ?????? ??? ?? ??? ??? IoT ??? ??
???? ??? ?? ??? ??? IoT ??? ??
Jong-Hyun Kim
?
?? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ??
?? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ???? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ??
?? ??? ??? ??? ?? ?? ?? ? ??? ?? ???? ??
Jong-Hyun Kim
?
???? ??? ??? IoT ??? ? ??
???? ??? ??? IoT ??? ? ?????? ??? ??? IoT ??? ? ??
???? ??? ??? IoT ??? ? ??
Jong-Hyun Kim
?
???? ?? ?? ???? ?? : ???? ??? ??
???? ?? ?? ???? ?? : ???? ??? ?????? ?? ?? ???? ?? : ???? ??? ??
???? ?? ?? ???? ?? : ???? ??? ??
Jong-Hyun Kim
?
??? ?? ????? ?? : ????? ???? ?? ???? SW??? ??
??? ?? ????? ?? : ????? ???? ?? ????  SW??? ????? ?? ????? ?? : ????? ???? ?? ????  SW??? ??
??? ?? ????? ?? : ????? ???? ?? ???? SW??? ??
Jong-Hyun Kim
?
???????????? ????????? ??????
???????????? ????????? ?????????????????? ????????? ??????
???????????? ????????? ??????
Jong-Hyun Kim
?
????? ??????????? ?????????? ???? SW ?? ????
????? ??????????? ?????????? ???? SW ?? ????????? ??????????? ?????????? ???? SW ?? ????
????? ??????????? ?????????? ???? SW ?? ????
Jong-Hyun Kim
?
????????? ?????? ????????? ?????
????????? ?????? ????????? ?????????????? ?????? ????????? ?????
????????? ?????? ????????? ?????
Jong-Hyun Kim
?

??? AI ?? ?????

  • 1. AI ?? ????? ? ? ? jhkim3217@gmail.com 2024. 2. ????? ??
  • 2. ?? ?? ? DJI Tello ?? ?? ? ??? ??, ????, Tello ?? ????(HW, SW) ? ? ?? ?? ??? ?? ?? ?? ?? ? ?? ??? ?? ? ? ? Tello SDK? ??? ??? ??(1) ? DJITelloPy ?? ? ?? ?? ?? ? takeoff, land, up/down, forward/backward, cw/ ccw ? ? ??? ?? ? Tello SDK? ??? ??? ??(2) ? OpenCV ?? ? ?? ??? ??? ?? ? ?? ? ?? ??? ?? ? ?? ? ??? ?? AI ?? ?? ? Cascade Classifier? ??? ?? ?? ? ?? ?? ? following me ?? ?? ? ? ???? : ???? AI ?? ??
  • 5. Tello ?? ?? ?? : https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20User%20Manual%20v1.4.pdf
  • 8. ??? ?? ?? : Quadcopter
  • 10. Tello ?? ?? ? ? Tello ??? ??? : https://bit.ly/3ygby6T
  • 11. Tello ?? ?? ? ? Tello ??? ??? : https://bit.ly/3ygby6T
  • 12. Tello ?? ?? ? ? Tello ??? ??? : https://bit.ly/3ygby6T
  • 13. Tello ?? ?? ? ? Tello ??? ??? : https://bit.ly/3ygby6T
  • 14. Tello ?? ?? ? ? Tello ??? ??? : https://bit.ly/3ygby6T
  • 15. ??01 : ?? ? ????
  • 17. ??? ?? ? ??? ?? ??? : https://www.python.org/ ? ??? 3.7 ~ 3.8 ????
  • 18. ???(??? ??????) ?? ? Pycharm Edu ???? ? ?? ? https://www.jetbrains.com/ko-kr/pycharm-edu/
  • 20. ??? ?? ????? ? Python Basics ???? ? https://bit.ly/3yiBxxz Code: print('Hello World') myData = 'Hello World' print(len(myData)) print(type(myData)) Result: Hello World 11 <class 'str'>
  • 21. DJITelloPy ?? ? API : djitellopy.readthedocs.io ? GitHub : https://github.com/damiafuentes/DJITelloPy ? DJITelloPy ?? ?? ? ??? ? pip install djitellopy==2.4.0 ? ??? ? [setting]->[Project]->[Python Interpreter] -> + ¡®djitellopy 2.4.0¡¯
  • 22. DJITelloPy ?? API : https://djitellopy.readthedocs.io/en/latest/tello/
  • 23. ?? ?? ?? ? takeoff/ land ? takeoff(), land() ? move up/ down ? move_up(), move_down() ? move left/ right ? move_left(), move_right() ? rotate_cw_ccw ? rotate_clockwise(), rotate_counter_clockwise() ? send_rc_control_async ? send_rc_control(self, left_right_velocity, forward_backward_velocity, up_down_velocity, yaw_velocity)
  • 24. ?? 01 ? takeoff -> landing
  • 25. from djitellopy import Tello import time print("Create Tello object") tello = Tello() print("Connect to Tello Drone") tello.connect() battery_level = tello.get_battery() print(f"Battery Life Percentage: {battery_level}") print("Takeoff!") tello.takeoff() print("Sleep for 5 seconds") time.sleep(5) print("landing") tello.land() print("touchdown.... goodbye")
  • 26. ?? 02 ? takeoff -> 3? up(40) -> down(40) ?? -> landing
  • 27. ?? 03 ? takeoff -> fwd(40) -> fwd(40) -> fwd(40) -> cw(180) -> fwd(40) -> fwd(40) -> fwd(40) -> land
  • 28. from djitellopy import Tello tello = Tello() tello.connect() tello.takeoff() tello.move_left(100) tello.rotate_clockwise(90) tello.move_forward(100) tello.land() ? ??
  • 29. ??? ???? : for in range() from djitellopy import Tello myTello = Tello() myTello.connect() myTello.takeoff() for i in range (0,3) : myTello.move_up(30) myTello.rotate_counter_clockwise(90) myTello.move_down(30) myTello.land() from djitellopy import Tello myTello = Tello() myTello.connect() myTello.takeoff() myTello.move_up(30) myTello.move_down(30) myTello.move_up(50) myTello.move_down(50) myTello.move_up(50) myTello.move_down(50) myTello.land()
  • 30. ??? ?? ???? : def from djitellopy import Tello myTello = Tello() myTello.connect() myTello.takeoff() myTello.move_up(30) myTello.move_down(30) myTello.move_up(30) myTello.move_down(30) myTello.move_up(30) myTello.move_down(30) myTello.land() def move_up_down(t): myTello.move_up(t) myTello.move_down(t) for i in range(3): t = 30 move_up_down(t)
  • 31. ?? 04 ? takeoff -> fwd(40) -> fwd(40) -> fwd(40) -> cw(180) -> fwd(40) -> fwd(40) -> fwd(40) -> cw(180) -> land ? fwd(40)? ????? ??? ??
  • 32. input() ??? ??? ?? ?? from djitellopy import tello myTello = tello.Tello() myTello.connect() battery_level = tello.get_battery() print(battery_level) while True: command = int(input("Enter Command!")) print(command, end="n") if (command == 1): myTello.takeoff() elif (command == 2): myTello.move_up(30) elif (command == 3): myTello.move_down(30) elif (command == 4): myTello.land() else: break print("Drone mission completed!")
  • 33. ?? 05 : input() ??? ??? ?? ??? ??? 1. Takeoff() 2. move_up(20) 3. move_down(20) 4. move_left(20) 5. move_right(20) 6. move_forward(20) 7. move_backward(20) 8. rotate_clockwise(90) 9. rotate_counter_clockwose(90) 10. flip_back() 11. flip_forward() 12. flip_left() 13. flip_right() 14. land()
  • 34. ?? 06 : cross flight ??
  • 35. ?? 06 : cross flight ?? from djitellopy import Tello import time print("Create Tello object") tello = Tello() print("Connect to Tello Drone") tello.connect() battery_level = tello.get_batte ry() print(battery_level) print("Takeoff!") tello.takeoff() time.sleep(1) travel_distance_cm = 50 #tello.go_xyz_speed(x,y,z, speed) # x - (+)foward/(-)backwards # y - (+)left/(-)right # z - (+)up/(-)down tello.go_xyz_speed(0, 0, travel_distance_cm, 20) print("sleep") time.sleep(0.5) tello.go_xyz_speed(0, travel_distance_cm, -travel_distanc e_cm, 20) print("sleep") time.sleep(0.5) tello.go_xyz_speed(0, 0, travel_distance_cm, 20) print("sleep") time.sleep(0.5) # x - (+)foward/(-)backwards # y - (+)left/(-)right # z - (+)up/(-)down tello.go_xyz_speed(0, -travel_distance_cm, -travel_distan ce_cm, 20) print("sleep") time.sleep(0.5) print("landing")
  • 36. Opencv? ??? ??? ???, ??? ?? https://opencv.org/
  • 37. ?? ?? ??, ???? import cv2 from djitellopy import Tello tello = Tello() tello.connect() tello.streamon() frame_read = tello.get_frame_read() tello.takeoff() cv2.imwrite("picture.png", frame_read.frame) tello.land()
  • 38. ?? ??? ??, ?? from djitellopy import tello import cv2 import time tello = tello.Tello() tello.connect() battery_level = tello.get_battery() print(f"Battery Life Percentage: {battery_level}") time.sleep(2) print("Turn Video Stream On") tello.streamon() # read a single image from the Tello video feed print("Read Tello Image") frame_read = tello.get_frame_read() print(type(frame_read)) time.sleep(2) while True: # read a single image from the Tello video feed print("Read Tello Image") tello_video_image = frame_read.frame # use opencv to write image if tello_video_image is not None: cv2.imshow("TelloVideo", tello_video_image) if cv2.waitKey(1) & 0xFF == ord('q'): break tello.streamoff() cv2.destroyWindow('TelloVideo') cv2.destroyAllWindows()
  • 39. ?? ??? ???? ? manual-control-opencv from djitellopy import Tello import cv2, math, time tello = Tello() tello.connect() tello.streamon() frame_read = tello.get_frame_read() while True: img = frame_read.frame cv2.imshow("drone", img) key = cv2.waitKey(1) & 0xff if key == 27: # ESC break elif key == ord('t'): tello.takeoff() elif key == ord('w'): tello.move_forward(30) elif key == ord('s'): tello.move_back(30) elif key == ord('a'): tello.move_left(30) elif key == ord('d'): tello.move_right(30) elif key == ord('e'): tello.rotate_clockwise(30) elif key == ord('q'): tello.rotate_counter_clockwise(30) elif key == ord('r'): tello.move_up(30) elif key == ord('f'): tello.move_down(30) tello.land() cv2.destroyAllWindows()
  • 40. ?? 04 ? ¡®?? ??? ????¡¯? ?? ??? ??, PC ??? ??? ? PC?? ??? ???? ?? ??? ???? ? cv2.VideoCapture(0) ? ret, frame = cap.read() ? cv2.imshow(¡°Video¡±, frame) ? https://github.com/DIT-AI-Drone- Course/SOURCE/blob/main/take_picture_opencv.py
  • 42. Opencv ?? ? https://opencv.org/ ? % pip install opencv-python ?? ??? add(+) opencv-python
  • 43. ??? Opencv ?? ?? ? ??? ? ?? -> ???? -> Python ????? -> + -> opencv-python
  • 44. ?? ?? ??, ???? import cv2 from djitellopy import Tello battery_level = tello.get_battery() print(battery_level) tello = Tello() tello.connect() tello.streamon() frame_read = tello.get_frame_read() tello.takeoff() cv2.imwrite("picture.png", frame_read.frame) tello.land()
  • 45. Opencv? ?? ??? ??, ?? from djitellopy import tello import cv2 import time tello = tello.Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) print("Turn Video Stream On") tello.streamon() time.sleep(2) while True: # read a single image from the Tello video feed frame_read = tello.get_frame_read() tello_video_image = frame_read.frame # ??? ?? ?? ¡° resize() image = cv2.resize(tello_video_image, (360, 240)) # use opencv to write image if image is not None: cv2.imshow("TelloVideo", image) if cv2.waitKey(1) & 0xFF == ord('q'): break tello.streamoff() cv2.destroyWindow('TelloVideo') cv2.destroyAllWindows()
  • 46. ?? ??? ??, ?? : Opencv ??? ?? from djitellopy import tello import cv2 import time tello = tello.Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) time.sleep(2) tello.streamon() frame_read = tello.get_frame_read() while True: frame = frame_read.frame frame = cv2.resize(frame, (360*2, 240*2)) # ??? ?? ?? while True: frame = frame_read.frame if frame is not None: cv2.imshow("TelloVideo", frame) k = cv2.waitKey(5) & 0xFF if k == ord('q'): break elif k == ord('t'): tello.takeoff() elif k == ord('u'): tello.move_up(50) elif k == ord('c'): tello.rotate_clockwise(360) elif k == ord('l'): tello.land() else : print(¡®no key!!!¡¯) tello.streamoff() cv2.destroyWindow('TelloVideo') cv2.destroyAllWindows()
  • 47. Opencv? ?? ??? ???? ? manual-control-opencv from djitellopy import Tello import cv2, time tello = Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) tello.streamon() frame_read = tello.get_frame_read() frame = cv2.resize(frame, (360*2, 240*2)) while True: img = frame_read.frame cv2.imshow("drone", img) key = cv2.waitKey(1) & 0xff if key == ord(¡®q¡¯): break elif key == ord('t'): tello.takeoff() elif key == ord(¡®f'): tello.move_forward(30) elif key == ord(¡®b'): tello.move_back(30) elif key == ord(¡®l'): tello.move_left(30) elif key == ord(¡®r'): tello.move_right(30) elif key == ord(¡®c'): tello.rotate_clockwise(30) elif key == ord(¡®r'): tello.rotate_counter_clockwise(30) elif key == ord(¡®u'): tello.move_up(30) elif key == ord(¡®d'): tello.move_down(30) tello.streamoff() cv2.destroyWindow(¡®drone') cv2.destroyAllWindows() ? ?? ?? : https://github.com/damiafuentes/DJITelloPy/ blob/master/examples/manual-control-opencv.py
  • 48. ??? ??/?? ??? ??? ???? : ???(Thread) import time, cv2 from threading import Thread from djitellopy import Tello tello = Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) keepRecording = True tello.streamon() frame_read = tello.get_frame_read() def videoRecorder(): height, width, _ = frame_read.frame.shape # create a VideoWrite object, recoring to ./video.avi video = cv2.VideoWriter('video3.avi', cv2.VideoWriter_fourcc(*'XVID'), 30, (width, height)) while keepRecording: tello_video_image = frame_read.frame tello_video_image = cv2.resize(tello_video_image, (360 * 2, 240 * 2)) # PC? Tello ?? ??? ?? video.write(frame_read.frame) if tello_video_image is not None: cv2.imshow('video', tello_video_image) time.sleep(1 / 30) if cv2.waitKey(1) & 0xFF == ord('q'): cv2.destroyWindow('video') cv2.destroyAllWindows() # we need to run the recorder in a seperate thread recorder = Thread(target=videoRecorder) recorder.start() tello.takeoff() tello.move_up(30) tello.rotate_counter_clockwise(360) tello.land() keepRecording = False recorder.join() ? ?? ?? ???? : https://drive.google.com/file/d/1jZD-DjCZK8cVg1r-20hhr4-RcYzW9-5-/view?usp=sharing
  • 49. ??? ?? AI ?? ??
  • 51. ? pre-training model ???? ? https://github.com/opencv/opencv/blob/master/data/haarcascades ?? ???? : Cascade Classifier
  • 52. ?? ???? : Cascade Classifier import cv2 from djitellopy import tello tello = tello.Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) tello.streamon() while True: img = tello.get_frame_read().frame img = cv2.resize(img, (360*2, 240*2)) faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiScale(imgGray, 1.3, 5) for (x, y, w, h) in faces: cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2) cv2.imshow('frame',img) if cv2.waitKey(1) & 0xFF == ord('q'): break tello.streamoff() cv2.destroyAllWindows()
  • 53. ?? ???? : Cascade Classifier import cv2 from djitellopy import tello tello = tello.Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) tello.streamon() while True: img = tello.get_frame_read().frame img = cv2.resize(img, (360, 240)) faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiScale(imgGray, 1.2, 8) for (x, y, w, h) in faces: cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2) cx = x + w // 2 cy = y + h // 2 area = w * h cv2.circle(img, (cx, cy), 5, (0, 255, 0), cv2.FILLED) print('area =', area) cv2.imshow('frame',img) if cv2.waitKey(1) & 0xFF == ord('q'): break cv2.destroyAllWindows() * ?? ?? : https://drive.google.com/file/d/1jZLuuovY-tWJdwy1LYD4knpCQkvAjzxk/view?usp=sharing * haarcascade_frontalface_default.xml ?? : https://drive.google.com/file/d/1j_Hjo0N6v0HtL1F55ekFBbQ6yxKT3SrQ/view?usp=sharing
  • 54. ?? ?? ??? ??? ??? ???
  • 55. Face Tracking ?? ?? ? back, forward ? ccw, cw ? up, down
  • 57. ??? ?? ???(cx, cy)? ?? ??? ???(tcx, tcy) ?? import cv2 from djitellopy import tello tello = tello.Tello() tello.connect() battery_level = tello.get_battery() print(battery_level) tello.streamon() while True: img = tello.get_frame_read().frame img = cv2.resize(img, (360*2, 240*2)) faceCascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") imgGray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiScale(imgGray, 1.3, 5) if len(faces) == 1: print("face found") print('faces', faces) else: print("face not found") # ?? ??? ???(center) tcx = 360 tcy = 240 cv2.circle(img, (tcx, tcy), 10, (255, 0, 0), cv2.FILLED) # ??? ?? ??? ?? ??? for (x, y, w, h) in faces: cv2.rectangle(img, (x, y), (x + w, y + h), (0, 0, 255), 2) cx = x + w // 2 cy = y + h // 2 area = w * h cv2.circle(img, (cx, cy), 10, (0, 255, 0), cv2.FILLED) print('area =', area) # ?? ??? ??? ?? ??? ?? ?? ? ???? cv2.line(img, (cx, cy), (tcx, tcy), (255, 0, 0), 2) cv2.imshow('frame',img) if cv2.waitKey(1) & 0xFF == ord('q'): break tello.streamoff() cv2.destroyAllWindows()
  • 58. forward/ backward ?? # ?? ??? ?? : z_area = offset_z offset_z = w * h # ?? ??? ?? update ? forward/ backward ?? def adjust_tello_position(offsetz): f not 15000 <= offset_z <= 30000 and offset_z != 0: if offset_z < 15000: tello.move_forward(20) elif offset_z > 30000: tello.move_back(20) ?? ?? : https://drive.google.com/file/d/1fJn9bOhB9cEKs71fDCtqzvWxQfNcb4z5/view?usp=sharing
  • 59. left/ right ?? offset_x = face_center_x - center_x def adjust_tello_position(offset_x): """ Adjusts the position of the tello drone based on the offset values given from th e frame :param offset_x: Offset between center and face x coordinates """ if not -90 <= offset_x <= 90 and offset_x != 0: # offset_x? ???? ?? ?? ???? ?? ?? ?? ?? if offset_x < 0: tello.rotate_counter_clockwise(10) # offset_x? ???? ?? ???? ?? ?? ?? ?? elif offset_x > 0: tello.rotate_clockwise(10) ?? ?? : https://drive.google.com/file/d/1WXTTag3aDv66SXSCYzapRxOcCA3PNnSK/view?usp=sharing
  • 60. up/ down ?? # Add 30 so that the drone covers as much of the subject as possible offset_y = face_center_y - center_y - 30 """ Adjusts the position of the tello drone based on the offset values given from the frame :param offset_y: Offset between center and face y coordinates """ if not -70 <= offset_y <= 70 and offset_y != -30: if offset_y < 0: print('move up') tello.move_up(20) elif offset_y > 0: print('move down') tello.move_down(20) ?? ?? : https://drive.google.com/file/d/1WXTTag3aDv66SXSCYzapRxOcCA3PNnSK/view?usp=sharing
  • 61. Face following ?? ?? ?? : https://drive.google.com/file/d/1f4Xcq8W4HL7tRSILb-hXrV9Jd-gywPPp/view?usp=sharing
  • 62. Face Detection AI ???? ? Haar Cascade ? https://github.com/opencv/opencv/blob/master/data/haarcascades/haarcas cade_frontalface_default.xml ? Dlib : HOG + CNN ? https://github.com/davisking/dlib ? MTCNN ? https://github.com/ipazc/mtcnn ? OpenCV DNN : Caffe based DNN ? https://github.com/opencv/opencv/tree/master/samples/dnn/face_detector ? YOLO ? https://velog.io/@hhhong/Object-Detection-with-YOLO
  • 63. AI ?? ???? ? PID ?? ? https://github.com/ivmech/ivPID ? Custom ?? ??? ? ????(fine tuning) ? PoseNet ? ??? ?? ?? ? Dlib ? facial landmark ?? ? YOLO ? ??? ?? ??
  • 64. ? ??? ?? ?? ?? ? MediaPipe ? https://google.github.io/mediapipe/
  • 65. ?? ?? ? https://www.youtube.com/watch?v=LmEcyQnfpDA&t=3576s ? https://github.com/juanmapf97/Tello-Face-Recognition ? https://google.github.io/mediapipe/ ? https://www.droneblocks.io/