Version 0

Materials

The Tello is a programmable, indoor drone. It has a downward facing camera usable for mission pad detection, and an accesible front facing camera. It receives commands from a laptop running a program using the djitellopy library.

The front camera is used to capture video of "grass" and that data is analyzed by the program.

Take Images

The code on the left makes the tello take off, take an image, store it to the computer under "picture.png", and lands.

>

Average Color Analysis

As a simple method to get started with green detection, average color was used.

This program cause the drone to go in a specified pattern, taking pictures at each position. At each of these positions, a photo would be taken. The "green differerntial" was outputted. The green differential was an average of g/r and g/b of the rgb values of all the pixels in the image.

This is not a good method since it takes in the whole image as one, instead of filtering parts of each image, but it was useful to learn this to be able to move onto a better method of analysis.

Image stitching is done at the end of the code and is exported as a file once the program was done.

RGB Pixel Ratio Analysis

The image on the left, binarizes the image to it's left based on green:red ratios.

Since the program is supposed to differentiate healthy and unhealthy grass, I created a comparision between "g" in RGB and "r" and "b". If "g" was 1.5 times higher han both "b" and "r", the area would be white, meaning that it passed the test. Black areas were filtered out.

As can be seen, it did work to an extent, but is still not perfect. Additionally, "grass" areas should be kept as the original colors in the file, not white.

Note - all drone movement was removed until the implementation of tkinter since these developments revolve around image processing rather than performing patterns.

HSV Pixel Range Analysis

After conducting some research, it was found out that the best way to approach this, in a color comparision method, would be to use HSV.

HSV is better than rgb in this scenario since hues can be more easily differentiated.

In this version, a mask was only applied on the pixels that did not meet the "green" criteria and other pixels were directly mapped from the original image.

This was a significant improvement from the previous iteration.

(Although this image does not show this), the data became smoother when using the value parameter. This was used to filter out white light that was being registered as a green hue. Future images will reflect this.

Drone Controls

Image processing is great, but a drone is no use without having the ability to bird. Tkinter was used to give the drone birding features through a controller window using tkinter.

Using tkinter, buttons were created. The video stream was added to the tkinter UI.

Pillow (PIL) was used to convert formats from cv2 to tkinter displayable video.

Example 1