AutoRef Honors2019 vision: Difference between revisions

From Control Systems Technology Group
Jump to navigation Jump to search
(Created page with '= Vision = == Ball tracking == To track the ball from the drone camera a python code was found and adapted. To track the ball a threshold in HSV color space is needed, this thre…')
 
No edit summary
Line 1: Line 1:
{{:AutoRef_Honors2019_Layout}}
<div align="left">
<font size="6"> '''AutoRef Honors 2019''' </font>
</div>
= Vision =
= Vision =
== Ball tracking ==
== Ball tracking ==

Revision as of 10:26, 24 May 2020


AutoRef Honors 2019


Vision

Ball tracking

To track the ball from the drone camera a python code was found and adapted. To track the ball a threshold in HSV color space is needed, this threshold represents a range of colors that the ball can show on camera due to different lighting.

The first thing the code will do is grab a frame from the video and make it into a standard size and apply a blur filter to create a less detailed image. Then all of the image that is not the color of the ball is made black, and more filters are applied to remove small parts in the image with the same color as the ball. Now a few functions of the cv2 package are used to encircle the largest piece of the image with the color of the ball. Then the center and radius of this circle are identified. A problem we ran into was that the ball was sometimes detected in an incorrect position due to a color flickering, we then added a feature to only look for the ball in the same region of the image where the ball was detected in the previous frame.

More on the code can be found here https://www.pyimagesearch.com/2015/09/14/ball-tracking-with-opencv/

Line detection

//