Close

May Update

A project log for Line Following Drone

A drone that can follow a line on the ground using computer vision, can implemented to follow rivers and map ecosystems.

nehaNeha 05/31/2019 at 13:370 Comments


After 3D printing the parts, the next steps we had to take were to configure the electronics on the drone. Betaflight was used to configure the flight characteristics of the drone.  First the accelerometer was calibrated, then the ESCs. Next the transmitter was set up to communicate with the drone using the SBUS interface. The BLHeli configurator was used to ensure that the motors spin the correct direction before the propellers were attached. The camera subsystem was worked on separately to stream video that could be used for line detection.


The line detection was done using C++, a coding language often used for image processing. The OpenCV library has a function called HoughLines that receives an image, grayscales it to reduce extraneous factors, and highlights the boundaries of the lines detected. The function considers each point on the image and defines a family of lines that go through that point. The lines, which are each defined by an r and θ value, are then plotted as a sinusoid. After each sinusoid is plotted, the function examines the intersections between them and the sinusoids that intersect are considered to be from the same line . A benefit of using this function is that it allows control of a threshold number of sinusoids in an intersection to be defined as a line, which can be used to reduce noise in an image and find only the necessary major line.


Next, the line detecting function had to be used with a video. An ffmpeg function was used to extract one frame every two seconds from an inputted video. The frames were then run through the HoughLines process and the lines were highlighted. 

Many individual aspects of the drone were completed, however unfortunately we were unable to fully assemble our drone due to delays in shipping of parts, however we achieved successful results with line detection. In the beginning, though the lines were often detected, other objects and lines in the image were also highlighted. These other lines would affect our control of the drone’s movements, so we increased the threshold in order to only highlight the main line We hoped to use the detected lines as boundaries for the drone’s movements

Discussions