Giter Site home page Giter Site logo

matufa / drone-autonomous-escape Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 3.0 330 KB

a drone autonomous escape from trees, by computer vision. (cv2)

License: GNU General Public License v3.0

Python 100.00%
opencv3-python python3 tello-sdk tello-drone

drone-autonomous-escape's Introduction

drone-autonomous-escape

Our project focuses on a "DJI Tello" drone, making it autonomously evade obsticles. We focused on evading trees, by processing the video from the drone at real time, and built an algorithm which will make it avoid the trees.

alt text

Demo

Alt text

Why havn't we used object detection methods like yolo/haar cascades/SSD?

At first, we tried to find (unsuccessfully) a trained weights for haar cascades. Then, we tried to train a haar cascade for detecting trees, but it didn't fit to our goal.

We also tried to use SSD (Single Shot Multi-box Detection), but SSD isn't doing really well in real time on our hardware (for 30 FPS minimum).

After that, we tried to use YoloV3, Yolo could've been great for detecting an object in real time. We decided to train a custom object detector but we had a lot of issues with YoloV3, C++ and Python. So, we searched for a pre-trained weights and found weights for 9000+ object (with a lot of trees type, perfect for our mission) but it also wasn't fast enough (for 30 FPS minimum, with our hardware).

Finally, we decideed to try some image processing manipulations with OpenCV in order to detect a specific range of brown. The best method we found was detecting brown contours using HSV. At the beginning we got a lot of detection, noise. So, we tried to minimize the noise but it wasn't good enough due to over detection. After testing, and with the help of Dr. Ben-Moshe we found that when the drone is about to crash into a tree, the tree is detected from bottom up. we started with a simple model which is described below.

HSV

alt text HSV is a Hue Saturation Value(Brightness). HSV is defined in a way that is similar to how humans perceive color. It's based on three values: hue, saturation, and value. This color space describes colors (hue or tint) in terms of their shade (saturation or amount of gray) and their brightness value. Some color pickers use the acronym HSB, which substitutes the term brightness for value, but HSV and HSB refer to the same color model. a short explanation from lifewire.

After a lot of testing we found out that the best result for us (in outdoor gardens, at sunny days):

  • H range is 10 - 20.
  • S range is 20 - 150.
  • V(B) range is 20 - 100.

Our brown detector is an implementation of HSV brown detector with OpenCV.

Screenshot

A place to improve

As you can see, our method is not the best. But for our case it's more than enough. We used a specific location at our university while we know enviroment outline. Detecting objects by processing the image colors is probably not good enough for moving objects, or for detecting objects at high speed.

Future research

How to detect a pop up object?

Python

use Python 3.* download here.

Requirements

  • keyboard
  • av
  • pykalman
  • pygame
  • matplotlib
  • opencv-python
  • numpy

Usage

  • Clone our project from github:
git clone https://github.com/MatufA/drone-autonomous-escape.git
  • Install requirements:
pip3 install -r requirements.txt
  • Run the project:
python3 -m drone_autonomous_escape

OpevCV Installation on Windows

See instruction here.

Authors

  • Amit Nuni - Autonomous Drone project - Profile
  • Adiel Matuf - Autonomous Drone project - Profile

License

This project is licensed under the GNU License - see the LICENSE file for details.

Credits

ofikodar for using his repository drone-auto-landing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.